From e5526617fe7bce7b90a785da8fa482ed41f11991 Mon Sep 17 00:00:00 2001 From: dev Date: Sat, 28 Nov 2026 12:43:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D0=BC=D0=B0=20=D0=BE=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F:=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BA=D0=BB=D1=8E=D1=87=D0=B0=D1=82=D0=B5=D0=BB?= =?UTF-8?q?=D1=8C=20=D0=B4=D0=BD=D1=8F,=20=D0=BD=D0=BE=D1=87=D0=B8=20?= =?UTF-8?q?=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE-=D1=80=D0=B5=D0=B6=D0=B8?= =?UTF-8?q?=D0=BC=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/admin-dark.css | 11 --------- public/admin.css | 5 ++++ public/admin.js | 26 +++++++++++++++++--- public/apikeys.html | 2 ++ public/audit.html | 2 ++ public/bans.html | 2 ++ public/bookmarks.html | 2 ++ public/branches.html | 2 ++ public/calendar.html | 2 ++ public/chat.html | 2 ++ public/dashboard.html | 2 ++ public/digest.html | 2 ++ public/docs.html | 2 ++ public/error.html | 2 ++ public/faces.html | 2 ++ public/feedback.html | 2 ++ public/files.html | 2 ++ public/groups.html | 2 ++ public/journal.html | 2 ++ public/js/theme.js | 52 +++++++++++++++++++++++++++++++++++++++ public/lessons.html | 2 ++ public/links.html | 2 ++ public/modules.html | 2 ++ public/notes.html | 2 ++ public/notifications.html | 2 ++ public/photos.html | 2 ++ public/postlesson.html | 2 ++ public/profile.html | 2 ++ public/settings.html | 2 ++ public/shorts.html | 2 ++ public/sidebar.html | 2 ++ public/student.html | 2 ++ public/students.html | 2 ++ public/trash.html | 2 ++ public/users.html | 2 ++ public/worker.html | 2 ++ 36 files changed, 143 insertions(+), 15 deletions(-) create mode 100644 public/js/theme.js diff --git a/public/admin-dark.css b/public/admin-dark.css index 054c64c..3f0595c 100644 --- a/public/admin-dark.css +++ b/public/admin-dark.css @@ -17,9 +17,6 @@ --text: #f1f5f9; --muted: #929db2; - --radius: 14px; - --sidebar: 250px; - --accent-hover: #a78bfa; --accent-soft: rgba(139, 92, 246, .13); --accent-glow: rgba(139, 92, 246, .25); @@ -579,14 +576,6 @@ html.midnight-neon body { color-scheme: dark; } -html.midnight-neon body, -html.midnight-neon button, -html.midnight-neon input, -html.midnight-neon select, -html.midnight-neon textarea { - font-family: inherit; -} - html.midnight-neon * { scrollbar-color: #343b4d #10131b; } diff --git a/public/admin.css b/public/admin.css index 29c5579..5de8013 100644 --- a/public/admin.css +++ b/public/admin.css @@ -68,6 +68,11 @@ body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;b .sidebar .bottom-actions a{display:flex;align-items:center;gap:10px;padding:6px 10px;border-radius:8px;color:var(--muted);text-decoration:none;font-size:.82rem;font-weight:500;transition:all .14s ease;position:relative} .sidebar .bottom-actions a:hover{color:var(--text);background:var(--bg)} .sidebar .bottom-actions a[data-nav=home] svg{color:#2563eb} +.sidebar .bottom-actions .home-row{display:flex;align-items:center;gap:2px;min-width:0} +.sidebar .bottom-actions .home-row a{flex:1;min-width:0} +.sidebar .theme-toggle{display:inline-flex;align-items:center;gap:4px;padding:5px 7px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:.72rem;font-weight:600;cursor:pointer;transition:background .14s ease,color .14s ease} +.sidebar .theme-toggle:hover{color:var(--text);background:var(--bg)} +.sidebar .theme-toggle svg{width:15px;height:15px;color:var(--accent)} .user-box .notify-bell svg{color:#f59e0b} .sidebar .bottom-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:6px;border-top:1px dashed var(--border)} .sidebar .bottom-footer .logout-btn{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:6px;color:#ef4444;text-decoration:none;font-size:.78rem;font-weight:600;cursor:pointer;transition:background .14s ease} diff --git a/public/admin.js b/public/admin.js index 1d5176a..4e4f99c 100644 --- a/public/admin.js +++ b/public/admin.js @@ -174,10 +174,13 @@ function buildSidebar(active) {
`; renderIcons(); + syncThemeToggle(); loadVersion(); loadBrand(); initNotifications(); @@ -546,6 +550,18 @@ function renderIcons() { } } +function syncThemeToggle() { + const btn = document.getElementById('themeToggle'); + if (!btn || !window.WhatIDoTheme) return; + const mode = WhatIDoTheme.get(); + btn.innerHTML = ``; + btn.title = 'Тема оформления · нажмите, чтобы переключить'; + btn.setAttribute('aria-label', btn.title); + renderIcons(); +} + +document.addEventListener('whatido:themechange', () => { syncThemeToggle(); }); + function showToast(msg, isError) { const t = document.getElementById('toast'); if (!t) return; @@ -1203,6 +1219,8 @@ function renderPager(el, page, totalPages, onPage) { } document.addEventListener('click', e => { + const themeBtn = e.target.closest('[data-theme-toggle]'); + if (themeBtn) { e.preventDefault(); if (window.WhatIDoTheme) WhatIDoTheme.next(); return; } const imgEl = e.target.closest('[data-img]'); if (imgEl) { e.preventDefault(); showImg(imgEl.dataset.img); return; } const out = e.target.closest('[data-action="logout"]'); diff --git a/public/apikeys.html b/public/apikeys.html index 8f65b29..9eee61a 100644 --- a/public/apikeys.html +++ b/public/apikeys.html @@ -5,6 +5,8 @@ API-ключи — Админ-панель + +
diff --git a/public/audit.html b/public/audit.html index fbf9c66..0457371 100644 --- a/public/audit.html +++ b/public/audit.html @@ -5,6 +5,8 @@ Аудит — Админ-панель + +
diff --git a/public/bans.html b/public/bans.html index 7c703e5..57883d1 100644 --- a/public/bans.html +++ b/public/bans.html @@ -5,6 +5,8 @@ Блокировки IP — Админ-панель + +
diff --git a/public/bookmarks.html b/public/bookmarks.html index 893abfe..ceefa66 100644 --- a/public/bookmarks.html +++ b/public/bookmarks.html @@ -5,6 +5,8 @@ Закладки — Админ-панель + +