diff --git a/static/admin/app.js b/static/admin/app.js index 4ee043d..befc2c9 100644 --- a/static/admin/app.js +++ b/static/admin/app.js @@ -34,6 +34,15 @@ document.addEventListener('DOMContentLoaded', () => { }); }); + document.querySelectorAll('.menu-group-header').forEach(button => { + button.addEventListener('click', () => { + const group = button.closest('.menu-group'); + if (group) { + group.classList.toggle('collapsed'); + } + }); + }); + // 登录表单 document.getElementById('login-form').addEventListener('submit', handleLogin); diff --git a/static/admin/index.html b/static/admin/index.html index 5631b1a..7943b42 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -16,15 +16,27 @@
Admin diff --git a/static/admin/style.css b/static/admin/style.css index 2e278ea..3f9e8b0 100644 --- a/static/admin/style.css +++ b/static/admin/style.css @@ -43,12 +43,52 @@ body { padding: 10px 0; } +.menu-group { + margin: 4px 12px 8px; + border-radius: 6px; + overflow: hidden; + background: rgba(255,255,255,0.04); +} + +.menu-group-header { + width: 100%; + border: none; + background: transparent; + color: #fff; + text-align: left; + padding: 12px 16px; + font-size: 13px; + font-weight: 600; + cursor: pointer; + letter-spacing: 0.5px; +} + +.menu-group-header::after { + content: '▾'; + float: right; + color: rgba(255,255,255,0.6); +} + +.menu-group.collapsed .menu-group-header::after { + content: '▸'; +} + +.menu-sub { + display: block; + padding-bottom: 4px; +} + +.menu-group.collapsed .menu-sub { + display: none; +} + .menu-item { display: block; - padding: 12px 20px; - color: rgba(255,255,255,0.7); + padding: 10px 20px 10px 32px; + color: rgba(255,255,255,0.75); text-decoration: none; transition: all 0.3s; + font-size: 14px; } .menu-item:hover,