mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-06 15:12:30 +09:00
Below 768px the persistent sidebar was set to display:none with no replacement, leaving every route unreachable on phones/tablets. It now collapses into an off-canvas drawer driven by a fixed mobile top bar. - MobileTopBar: fixed header with hamburger toggle + brand (white-label aware, solid wordmark), shown only < 768px - Sidebar becomes a translateX drawer at min(280px, 86vw); focus trap, Escape-to-close, inert when closed (React 18 safe), 44px close button, aria-label + id wired to the toggle's aria-controls - DashboardLayout owns open state via useMediaQuery, closes on route change, locks body scroll, renders the scrim - Semantic z-index ladder (scrim/drawer/header), 100dvh + safe-area insets, viewport-fit=cover, prefers-reduced-motion fallback - Main content offset below the fixed header for normal and full-page routes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
38 lines
1.7 KiB
HTML
38 lines
1.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
<meta name="description" content="ServerKit - Server Management Dashboard" />
|
|
<title>ServerKit</title>
|
|
<script>
|
|
// Prevent flash of unstyled content (FOUC) by setting theme + accent before React loads
|
|
(function() {
|
|
var d = document.documentElement;
|
|
d.setAttribute('data-theme', localStorage.getItem('theme') || 'dark');
|
|
var accent = localStorage.getItem('accent_color');
|
|
if (accent) {
|
|
var m = accent.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);
|
|
if (m) {
|
|
var r = parseInt(m[1],16), g = parseInt(m[2],16), b = parseInt(m[3],16);
|
|
var dk = function(v){ return Math.max(0, Math.round(v*0.88)); };
|
|
d.style.setProperty('--accent-primary', accent);
|
|
d.style.setProperty('--accent-hover', '#'+dk(r).toString(16).padStart(2,'0')+dk(g).toString(16).padStart(2,'0')+dk(b).toString(16).padStart(2,'0'));
|
|
d.style.setProperty('--accent-glow', 'rgba('+r+','+g+','+b+',0.15)');
|
|
d.style.setProperty('--accent-shadow', 'rgba('+r+','+g+','+b+',0.3)');
|
|
}
|
|
}
|
|
})();
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="root"></div>
|
|
<script type="module" src="/src/main.jsx"></script>
|
|
</body>
|
|
|
|
</html> |