This commit is contained in:
2026-03-04 21:05:21 +01:00
parent b04a404654
commit bd683597c9
6 changed files with 255 additions and 464 deletions

View File

@@ -6,6 +6,15 @@
{ "label": "Hosts", "href": "/module/kea" }, { "label": "Hosts", "href": "/module/kea" },
{ "label": "Setup", "href": "/modules/setup/kea" } { "label": "Setup", "href": "/modules/setup/kea" }
], ],
"sidebar": {
"enabled": true,
"collapsible": true,
"default": "collapsed",
"items": [
{ "label": "Hosts", "href": "/module/kea" },
{ "label": "Setup", "href": "/modules/setup/kea" }
]
},
"setup": { "setup": {
"fields": [ "fields": [
{ "name": "db.driver", "label": "DB Driver", "type": "text", "required": true }, { "name": "db.driver", "label": "DB Driver", "type": "text", "required": true },

View File

@@ -1,11 +1,9 @@
</main> </main>
</div>
<footer class="site-footer"> <footer class="site-footer">
<div class="footer-left">© <?= date('Y') ?> Nexus</div> <div class="footer-left">© <?= date('Y') ?> Nexus</div>
<div class="footer-right">Security first · Internal only</div> <div class="footer-right">Security first · Internal only</div>
</footer> </footer>
</div>
</div>
</div>
<?php asset_scripts('footer'); ?> <?php asset_scripts('footer'); ?>
</body> </body>
</html> </html>

View File

@@ -7,10 +7,16 @@ $theme = user_theme();
$currentModule = current_module_name(); $currentModule = current_module_name();
$path = $app->request()->path(); $path = $app->request()->path();
$moduleMenu = []; $moduleMenu = [];
$moduleSidebar = [];
if ($currentModule) { if ($currentModule) {
$module = modules()->get($currentModule); $module = modules()->get($currentModule);
$moduleMenu = $module['menu'] ?? []; $moduleMenu = $module['menu'] ?? [];
$moduleSidebar = $module['sidebar'] ?? [];
} }
$sidebarEnabled = !empty($moduleSidebar['enabled']);
$sidebarCollapsible = !empty($moduleSidebar['collapsible']);
$sidebarDefault = ($moduleSidebar['default'] ?? 'collapsed') === 'open' ? 'open' : 'collapsed';
$sidebarItems = $moduleSidebar['items'] ?? [];
?> ?>
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
@@ -24,12 +30,12 @@ if ($currentModule) {
<body data-theme="<?= e($theme) ?>"> <body data-theme="<?= e($theme) ?>">
<div class="bg-orb orb-a"></div> <div class="bg-orb orb-a"></div>
<div class="bg-orb orb-b"></div> <div class="bg-orb orb-b"></div>
<div class="app-shell">
<header class="topbar card"> <header class="site-header card">
<div class="topbar-left"> <div class="logo-wrap">
<img src="/assets/images/logo.png" alt="Nexus Logo" class="topbar-logo"> <img src="/assets/images/logo.png" alt="Nexus Logo" class="site-logo">
</div> </div>
<div class="topbar-actions"> <nav class="header-nav">
<a class="nav-link" href="/">Dashboard</a> <a class="nav-link" href="/">Dashboard</a>
<div class="dropdown"> <div class="dropdown">
<button class="nav-link dropdown-toggle" type="button">Module ▾</button> <button class="nav-link dropdown-toggle" type="button">Module ▾</button>
@@ -52,44 +58,18 @@ if ($currentModule) {
</button> </button>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-header"><?= e(auth_display_name()) ?></div> <div class="dropdown-header"><?= e(auth_display_name()) ?></div>
<a class="dropdown-item" href="/settings">Settings</a> <a class="dropdown-item" href="/settings">User-Settings</a>
<a class="dropdown-item" href="/auth/logout">Logout</a> <a class="dropdown-item" href="/auth/logout">Logout</a>
</div> </div>
<?php elseif (auth_enabled()): ?> <?php elseif (auth_enabled()): ?>
<a class="nav-link" href="/auth/login">Login</a> <a class="nav-link" href="/auth/login">Login</a>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div>
</header>
<div class="layout-body">
<aside class="app-sidebar">
<div class="brand-text"></div>
<button class="sidebar-toggle" data-sidebar-toggle aria-label="Menü ein-/ausklappen">
<span class="sidebar-icon">☰</span>
<span class="sidebar-collapse">»»</span>
</button>
<nav class="sidebar-nav">
<a href="/" class="nav-link <?= $path === '/' ? 'is-active' : '' ?>">Dashboard</a>
<div class="nav-section">Aktive Module</div>
<?php foreach (modules()->all() as $m): ?>
<?php if (!empty($m['enabled'])): ?>
<?php $active = $currentModule === $m['name']; ?>
<a href="/module/<?= e($m['name']) ?>" class="nav-link <?= $active ? 'is-active' : '' ?>"><?= e($m['title']) ?></a>
<?php endif; ?>
<?php endforeach; ?>
<a href="/modules" class="nav-link <?= str_starts_with($path, '/modules') ? 'is-active' : '' ?>">Module</a>
<a href="/users" class="nav-link <?= $path === '/users' ? 'is-active' : '' ?>">User</a>
<a href="/settings" class="nav-link <?= $path === '/settings' ? 'is-active' : '' ?>">Einstellungen</a>
</nav> </nav>
</aside> </header>
<div class="app-content">
<button class="floating-toggle" data-sidebar-toggle aria-label="Menü einblenden">»»</button>
<?php if ($moduleMenu): ?> <?php if ($moduleMenu): ?>
<div class="module-subnav"> <div class="module-subnav card">
<?php foreach ($moduleMenu as $entry): ?> <?php foreach ($moduleMenu as $entry): ?>
<a class="nav-link" href="<?= e($entry['href'] ?? '#') ?>"> <a class="nav-link" href="<?= e($entry['href'] ?? '#') ?>">
<?= e($entry['label'] ?? 'Link') ?> <?= e($entry['label'] ?? 'Link') ?>
@@ -98,9 +78,29 @@ if ($currentModule) {
</div> </div>
<?php endif; ?> <?php endif; ?>
<main class="site-main"> <div class="layout-body <?= $sidebarEnabled ? 'has-sidebar' : 'no-sidebar' ?> <?= $sidebarDefault === 'open' ? 'sidebar-open' : 'sidebar-collapsed' ?>"
<?php if (defined('APP_DEBUG_TOOL') && APP_DEBUG_TOOL): ?> data-sidebar-enabled="<?= $sidebarEnabled ? '1' : '0' ?>"
<a class="debug-fab" href="/debug" title="Debug"> data-sidebar-collapsible="<?= $sidebarCollapsible ? '1' : '0' ?>"
🐞 data-sidebar-default="<?= e($sidebarDefault) ?>">
</a>
<?php if ($sidebarEnabled): ?>
<aside class="sidebar card">
<?php if ($sidebarCollapsible): ?>
<button class="sidebar-toggle" data-sidebar-toggle aria-label="Menü ein-/ausklappen">»»</button>
<?php endif; ?>
<div class="sidebar-items">
<?php foreach ($sidebarItems as $item): ?>
<a class="nav-link" href="<?= e($item['href'] ?? '#') ?>"><?= e($item['label'] ?? 'Item') ?></a>
<?php endforeach; ?>
</div>
</aside>
<?php endif; ?>
<main class="main-content">
<?php if ($sidebarEnabled && $sidebarCollapsible): ?>
<button class="sidebar-fab" data-sidebar-toggle aria-label="Menü einblenden">»»</button>
<?php endif; ?>
<?php if (defined('APP_DEBUG_TOOL') && APP_DEBUG_TOOL): ?>
<a class="debug-fab" href="/debug" title="Debug">🐞</a>
<?php endif; ?> <?php endif; ?>

View File

@@ -1,51 +1,15 @@
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Space+Grotesk:wght@400;600;700&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&family=IBM+Plex+Mono:wght@400;600&display=swap');
:root { :root {
--bg: #f4f6fb; --bg: #f5f7fb;
--panel: #ffffff; --panel: #ffffff;
--panel-2: #f0f3fb; --panel-2: #eef2ff;
--text: #151a2d; --text: #111827;
--muted: #5a6685; --muted: #5b6475;
--accent: #ff6b4a; --accent: #ff5a3d;
--accent-2: #0fb4a4; --accent-2: #00b3a4;
--line: #d7dceb; --line: #d7dceb;
--shadow: 0 20px 50px rgba(22, 32, 74, 0.12); --shadow: 0 18px 36px rgba(20, 32, 64, 0.15);
}
body[data-theme="light"] {
--bg: #f4f6fb;
--panel: #ffffff;
--panel-2: #f0f3fb;
--text: #151a2d;
--muted: #5a6685;
--accent: #ff6b4a;
--accent-2: #0fb4a4;
--line: #d7dceb;
--shadow: 0 20px 50px rgba(22, 32, 74, 0.12);
}
body[data-theme="ocean"] {
--bg: #eef6ff;
--panel: #ffffff;
--panel-2: #e6f0ff;
--text: #0b1b33;
--muted: #3a4c6e;
--accent: #2d7bff;
--accent-2: #00b6b2;
--line: #c9d9f3;
--shadow: 0 20px 50px rgba(22, 32, 74, 0.12);
}
body[data-theme="graphite"] {
--bg: #f7f7f8;
--panel: #ffffff;
--panel-2: #eceff3;
--text: #1e222a;
--muted: #5c667a;
--accent: #ff7a00;
--accent-2: #6b7bff;
--line: #d5d8df;
--shadow: 0 20px 50px rgba(20, 24, 34, 0.12);
} }
* { box-sizing: border-box; } * { box-sizing: border-box; }
@@ -53,8 +17,8 @@ html, body { height: 100%; }
body { body {
margin: 0; margin: 0;
font-family: "Space Grotesk", "Segoe UI", sans-serif; font-family: "Space Grotesk", "Segoe UI", sans-serif;
background: radial-gradient(1200px 500px at 10% -10%, rgba(255, 107, 74, 0.12), transparent 60%), background: radial-gradient(1200px 500px at 10% -10%, rgba(255, 90, 61, 0.15), transparent 60%),
radial-gradient(900px 500px at 90% 10%, rgba(15, 180, 164, 0.12), transparent 55%), radial-gradient(900px 500px at 90% 10%, rgba(0, 179, 164, 0.12), transparent 55%),
var(--bg); var(--bg);
color: var(--text); color: var(--text);
} }
@@ -64,210 +28,58 @@ body {
width: 420px; width: 420px;
height: 420px; height: 420px;
border-radius: 50%; border-radius: 50%;
filter: blur(80px); filter: blur(90px);
opacity: 0.4; opacity: 0.35;
z-index: 0; z-index: 0;
pointer-events: none; pointer-events: none;
} }
.orb-a { top: -120px; left: -80px; background: #ff5e5b; } .orb-a { top: -140px; left: -100px; background: #ff5a3d; }
.orb-b { bottom: -160px; right: -120px; background: #20e3b2; } .orb-b { bottom: -180px; right: -120px; background: #00b3a4; }
.app-shell { .card {
position: relative;
z-index: 1;
min-height: 100vh;
display: grid;
grid-template-columns: 1fr;
gap: 14px;
padding: 18px 24px 24px;
}
.app-sidebar {
background: var(--panel); background: var(--panel);
border: 1px solid var(--line); border: 1px solid var(--line);
border-radius: 18px; border-radius: 18px;
padding: 20px;
box-shadow: var(--shadow); box-shadow: var(--shadow);
display: flex; }
flex-direction: column;
gap: 18px; .site-header {
position: sticky; position: sticky;
top: 110px; top: 0;
height: fit-content; z-index: 20;
transform: translateX(-12px); margin: 18px 24px 8px;
opacity: 0; padding: 10px 16px;
pointer-events: none;
transition: transform 260ms ease, opacity 260ms ease;
}
.sidebar-toggle {
background: var(--panel-2);
border: 1px solid var(--line);
border-radius: 10px;
padding: 8px 10px;
cursor: pointer;
color: var(--text);
font-weight: 700;
}
.sidebar-collapse { display: none; }
.floating-toggle {
display: none;
position: fixed;
left: 24px;
bottom: 24px;
width: 52px;
height: 52px;
border-radius: 50%;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow);
align-items: center;
justify-content: center;
font-weight: 800;
z-index: 60;
}
.layout-body.sidebar-open .app-sidebar {
transform: translateX(0);
opacity: 1;
pointer-events: auto;
}
.layout-body.sidebar-open .app-content {
transition: transform 260ms ease;
}
.sidebar-collapsed .floating-toggle {
display: inline-flex;
}
.brand {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 14px; justify-content: space-between;
} gap: 16px;
.topbar-logo {
height: 80px;
width: auto;
filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12));
margin-right: 10px;
}
.brand img {
height: 46px;
width: auto;
filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}
.brand-title {
font-weight: 700;
letter-spacing: 0.4px;
font-size: 1.2rem;
}
.brand-sub {
color: var(--muted);
font-size: 0.9rem;
} }
.sidebar-nav { .logo-wrap { display: flex; align-items: center; }
.site-logo { height: 80px; width: auto; filter: drop-shadow(0 6px 12px rgba(0,0,0,0.12)); }
.header-nav {
display: flex; display: flex;
flex-direction: column; align-items: center;
gap: 8px; gap: 12px;
}
.nav-section {
color: var(--muted);
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 0.08em;
margin-top: 6px;
} }
.nav-link { .nav-link {
color: var(--text); color: var(--text);
text-decoration: none; text-decoration: none;
padding: 8px 14px; padding: 8px 14px;
border-radius: 10px; border-radius: 10px;
border: 1px solid transparent; border: 1px solid transparent;
transition: all 180ms ease;
font-weight: 600; font-weight: 600;
transition: all 180ms ease;
} }
.nav-link:hover { .nav-link:hover {
border-color: var(--line); border-color: var(--line);
background: var(--panel-2); background: var(--panel-2);
} }
.nav-link.is-active {
color: #ffffff;
background: var(--accent);
border-color: var(--accent);
}
.cta-button { .dropdown { position: relative; display: inline-flex; }
background: linear-gradient(120deg, var(--accent), #ff9f45); .dropdown-toggle { background: transparent; }
border: none;
color: #ffffff;
font-weight: 700;
padding: 10px 18px;
border-radius: 12px;
cursor: pointer;
box-shadow: 0 14px 30px rgba(255, 94, 91, 0.35);
}
.app-content {
display: flex;
flex-direction: column;
gap: 16px;
}
.layout-body {
display: grid;
grid-template-columns: 1fr;
gap: 16px;
transition: grid-template-columns 260ms ease;
}
.layout-body.sidebar-open {
grid-template-columns: 260px 1fr;
}
.topbar {
position: sticky;
top: 0;
z-index: 20;
margin: 0;
grid-column: 1 / -1;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 18px;
padding: 6px 14px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
box-shadow: var(--shadow);
min-height: 88px;
}
.topbar { position: relative; }
.topbar::after {
content: "";
position: absolute;
inset: 0;
border-radius: 18px;
box-shadow: 0 18px 30px rgba(22, 32, 74, 0.12);
pointer-events: none;
}
.page-title {
margin: 0;
font-size: 1.25rem;
}
.topbar-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.dropdown {
position: relative;
display: inline-flex;
}
.dropdown-toggle {
background: transparent;
}
.dropdown-menu { .dropdown-menu {
position: absolute; position: absolute;
top: 110%; top: 110%;
@@ -283,9 +95,7 @@ body {
} }
.dropdown-menu-right { right: 0; left: auto; } .dropdown-menu-right { right: 0; left: auto; }
.dropdown:hover .dropdown-menu, .dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { .dropdown:focus-within .dropdown-menu { display: block; }
display: block;
}
.dropdown-item { .dropdown-item {
display: block; display: block;
padding: 8px 10px; padding: 8px 10px;
@@ -294,25 +104,11 @@ body {
text-decoration: none; text-decoration: none;
font-weight: 600; font-weight: 600;
} }
.dropdown-item:hover { .dropdown-item:hover { background: var(--panel-2); }
background: var(--panel-2); .dropdown-divider { height: 1px; background: var(--line); margin: 6px 4px; }
} .dropdown-header { padding: 6px 10px; font-size: 0.85rem; color: var(--muted); }
.dropdown-divider {
height: 1px; .avatar-btn { background: transparent; border: none; padding: 0; cursor: pointer; }
background: var(--line);
margin: 6px 4px;
}
.dropdown-header {
padding: 6px 10px;
font-size: 0.85rem;
color: var(--muted);
}
.avatar-btn {
background: transparent;
border: none;
padding: 0;
cursor: pointer;
}
.avatar { .avatar {
width: 34px; width: 34px;
height: 34px; height: 34px;
@@ -326,13 +122,78 @@ body {
} }
.module-subnav { .module-subnav {
margin: 0 24px 8px;
padding: 8px 12px;
display: flex; display: flex;
gap: 10px; gap: 10px;
flex-wrap: wrap; flex-wrap: wrap;
padding: 8px 12px; }
border: 1px solid var(--line);
border-radius: 12px; .layout-body {
display: grid;
grid-template-columns: 1fr;
gap: 16px;
padding: 0 24px 24px;
transition: grid-template-columns 260ms ease;
}
.layout-body.sidebar-open {
grid-template-columns: 260px 1fr;
}
.sidebar {
padding: 16px;
display: flex;
flex-direction: column;
gap: 12px;
position: sticky;
top: 120px;
height: fit-content;
transform: translateX(-12px);
opacity: 0;
pointer-events: none;
transition: transform 260ms ease, opacity 260ms ease;
}
.layout-body.sidebar-open .sidebar {
transform: translateX(0);
opacity: 1;
pointer-events: auto;
}
.sidebar-toggle {
align-self: flex-start;
background: var(--panel-2); background: var(--panel-2);
border: 1px solid var(--line);
border-radius: 10px;
padding: 6px 10px;
cursor: pointer;
font-weight: 700;
}
.sidebar-items .nav-link { display: block; }
.sidebar-fab {
position: fixed;
left: 24px;
bottom: 24px;
width: 52px;
height: 52px;
border-radius: 50%;
background: var(--panel);
border: 1px solid var(--line);
box-shadow: var(--shadow);
font-weight: 800;
z-index: 60;
}
.main-content { min-height: 60vh; }
.site-footer {
margin: 0 24px 24px;
padding: 10px 16px;
color: var(--muted);
display: flex;
justify-content: space-between;
font-size: 0.85rem;
} }
.debug-fab { .debug-fab {
@@ -349,55 +210,10 @@ body {
justify-content: center; justify-content: center;
text-decoration: none; text-decoration: none;
font-size: 22px; font-size: 22px;
box-shadow: 0 16px 32px rgba(255, 107, 74, 0.28); box-shadow: 0 16px 32px rgba(255, 90, 61, 0.28);
z-index: 50; z-index: 50;
} }
.debug-fab:hover {
filter: brightness(0.95);
}
.site-main {
flex: 1;
}
.site-footer {
display: flex;
justify-content: space-between;
color: var(--muted);
font-size: 0.85rem;
padding: 20px 4px 0;
}
.card {
background: var(--panel);
border: 1px solid var(--line);
border-radius: 18px;
padding: 24px;
box-shadow: var(--shadow);
}
.card input,
.card textarea {
background: #ffffff;
border: 1px solid var(--line);
color: var(--text);
padding: 10px 12px;
border-radius: 10px;
font-family: inherit;
}
.card select {
background: #ffffff;
border: 1px solid var(--line);
color: var(--text);
padding: 10px 12px;
border-radius: 10px;
font-family: inherit;
}
.card input:focus,
.card textarea:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(255, 94, 91, 0.2);
}
.muted { color: var(--muted); } .muted { color: var(--muted); }
.pill { .pill {
display: inline-flex; display: inline-flex;
@@ -407,92 +223,51 @@ body {
border-radius: 999px; border-radius: 999px;
border: 1px solid var(--line); border: 1px solid var(--line);
color: var(--muted); color: var(--muted);
background: rgba(255,255,255,0.03); background: rgba(255,255,255,0.6);
font-size: 0.85rem; font-size: 0.85rem;
} }
.grid {
display: grid; .card input,
grid-template-columns: repeat(2, minmax(0, 1fr)); .card textarea,
gap: 16px; .card select {
background: #ffffff;
border: 1px solid var(--line);
color: var(--text);
padding: 10px 12px;
border-radius: 10px;
font-family: inherit;
} }
@media (max-width: 1100px) { .cta-button {
.app-shell { grid-template-columns: 1fr; padding: 18px; } background: linear-gradient(120deg, var(--accent), #ff9f45);
.app-sidebar { position: relative; top: 0; } border: none;
} color: #ffffff;
@media (max-width: 720px) { font-weight: 700;
.grid { grid-template-columns: 1fr; } padding: 10px 18px;
.topbar { flex-direction: column; align-items: flex-start; } border-radius: 12px;
cursor: pointer;
box-shadow: 0 14px 30px rgba(255, 90, 61, 0.35);
} }
/* Minimal Tailwind-like utility support for existing templates */ /* Minimal utility support (tables + spacing) */
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; } .px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; } .py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; } .py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
@media (min-width: 640px) {
.sm\\:px-0 { padding-left: 0; padding-right: 0; }
.sm\\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.sm\\:rounded-lg { border-radius: 0.75rem; }
}
.text-white { color: #ffffff; }
.text-gray-200 { color: #3a4c6e; }
.text-gray-300 { color: #4b5775; }
.text-gray-400 { color: #5a6685; }
.text-gray-500 { color: #6b7696; }
.text-red-100 { color: #8b1d1d; }
.text-indigo-400 { color: #2d7bff; }
.hover\\:text-indigo-300:hover { color: #1b63da; }
.font-medium { font-weight: 600; }
.font-semibold { font-weight: 700; }
.font-bold { font-weight: 700; }
.text-sm { font-size: 0.9rem; }
.text-lg { font-size: 1.1rem; }
.text-2xl { font-size: 1.6rem; }
.uppercase { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; }
.tracking-wider { letter-spacing: 0.06em; }
.leading-6 { line-height: 1.5; }
.whitespace-nowrap { white-space: nowrap; }
.text-left { text-align: left; } .text-left { text-align: left; }
.text-right { text-align: right; } .text-sm { font-size: 0.9rem; }
.divide-y > * + * { border-top: 1px solid var(--line); } .text-xs { font-size: 0.75rem; }
.border { border: 1px solid var(--line); } .uppercase { text-transform: uppercase; letter-spacing: 0.08em; }
.border-l-4 { border-left: 4px solid; } .font-medium { font-weight: 600; }
.border-red-500 { border-color: #ff5e5b; }
.border-gray-700 { border-color: var(--line); }
.bg-gray-800 { background: var(--panel); }
.bg-gray-900 { background: var(--panel-2); }
.bg-red-900 { background: #ffe9e9; }
.shadow { box-shadow: var(--shadow); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.min-w-full { min-width: 100%; }
.divide-gray-700 > * + * { border-top: 1px solid var(--line); }
.bg-indigo-600 { background: #4f46e5; }
.hover\\:bg-indigo-700:hover { background: #4338ca; }
.rounded { border-radius: 12px; }
.rounded-lg { border-radius: 14px; }
.transition-colors { transition: color 180ms ease, background 180ms ease; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.max-w-2xl { max-width: 42rem; }
.relative { position: relative; }
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.font-mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; } .font-mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.hover\\:bg-gray-750:hover { background: #151a28; } .bg-gray-900 { background: var(--panel-2); }
.bg-gray-800 { background: var(--panel); }
.divide-y > * + * { border-top: 1px solid var(--line); }
.border-gray-700 { border-color: var(--line); }
@media (max-width: 900px) {
.site-header { margin: 12px; }
.layout-body { padding: 0 12px 12px; }
.module-subnav { margin: 0 12px 8px; }
.site-footer { margin: 0 12px 12px; }
.header-nav { flex-wrap: wrap; justify-content: flex-end; }
}

View File

@@ -1,21 +1,29 @@
(() => { (() => {
const toggles = document.querySelectorAll('[data-sidebar-toggle]');
const layout = document.querySelector('.layout-body'); const layout = document.querySelector('.layout-body');
if (!layout) return;
const enabled = layout.dataset.sidebarEnabled === '1';
const collapsible = layout.dataset.sidebarCollapsible === '1';
const defaultState = layout.dataset.sidebarDefault || 'collapsed';
const toggles = document.querySelectorAll('[data-sidebar-toggle]');
if (!enabled || !collapsible) {
toggles.forEach((t) => t.remove());
return;
}
const saved = localStorage.getItem('sidebar-state');
const initial = saved || defaultState;
if (initial === 'open') {
layout.classList.add('sidebar-open');
} else {
layout.classList.remove('sidebar-open');
}
toggles.forEach((toggle) => { toggles.forEach((toggle) => {
toggle.addEventListener('click', () => { toggle.addEventListener('click', () => {
document.body.classList.toggle('sidebar-collapsed'); layout.classList.toggle('sidebar-open');
layout?.classList.toggle('sidebar-open'); localStorage.setItem('sidebar-state', layout.classList.contains('sidebar-open') ? 'open' : 'collapsed');
const collapsed = document.body.classList.contains('sidebar-collapsed');
localStorage.setItem('sidebar-collapsed', collapsed ? '1' : '0');
}); });
}); });
const saved = localStorage.getItem('sidebar-collapsed');
const collapsed = (saved === null || saved === '1');
if (collapsed) {
document.body.classList.add('sidebar-collapsed');
layout?.classList.remove('sidebar-open');
} else {
layout?.classList.add('sidebar-open');
}
})(); })();

View File

@@ -209,6 +209,7 @@ final class ModuleManager
'description' => $data['description'] ?? '', 'description' => $data['description'] ?? '',
'setup' => $data['setup'] ?? [], 'setup' => $data['setup'] ?? [],
'menu' => $data['menu'] ?? [], 'menu' => $data['menu'] ?? [],
'sidebar' => $data['sidebar'] ?? [],
'db_defaults' => $data['db_defaults'] ?? [], 'db_defaults' => $data['db_defaults'] ?? [],
'path' => $dir, 'path' => $dir,
'enabled' => false, 'enabled' => false,