feat: тёмная тема на admin/register/security + бамп версии
Распространил тёмную тему на остальные живые страницы (админка, регистрация, страница безопасности) — выбор общий с чатом через localStorage['theme'], FOUC-скрипт в <head>, переключатель (в навигации админки / плавающая кнопка на register и security). Палитра та же, что в чате. Депрекированные фреймы (batch3/ssr/wizard/generate/reference/check — кнопки закомментированы) не трогал. Версия: v.2026-06-10b. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,27 @@ a { color: var(--accent); text-decoration: none; }
|
||||
.btn { padding: .5rem 1rem; background: var(--accent); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: .85rem; }
|
||||
.btn:hover { background: #a83830; }
|
||||
.btn-sm { padding: 2px 8px; font-size: .7rem; margin: 1px; cursor: pointer; border: 1px solid var(--border); border-radius: 3px; background: var(--card); }
|
||||
|
||||
/* ===== Тёмная тема (общая с чатом; выбор хранится в localStorage['theme']) ===== */
|
||||
html { color-scheme: light; }
|
||||
:root[data-theme="dark"] {
|
||||
color-scheme: dark;
|
||||
--bg: #16140f; --card: #211d17; --text: #ece4d7; --muted: #a89c8a;
|
||||
--accent: #d9695c; --border: #3a332a;
|
||||
--sidebar: #201c16; --sidebar-text: #d8cdbd; --sidebar-active: #d9695c; --green: #3fa066;
|
||||
}
|
||||
:root[data-theme="dark"] th { background: #2a2620; }
|
||||
:root[data-theme="dark"] td { border-top-color: #2f2820; }
|
||||
:root[data-theme="dark"] table, :root[data-theme="dark"] .stat-card { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
|
||||
:root[data-theme="dark"] .btn:hover { background: #c2564a; }
|
||||
</style>
|
||||
<script>
|
||||
/* Тема до первой отрисовки (FOUC): сохранённый выбор → система → светлая */
|
||||
(function(){try{var t=localStorage.getItem('theme');if(t!=='dark'&&t!=='light'){t=(window.matchMedia&&matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light';}document.documentElement.setAttribute('data-theme',t);}catch(e){}})();
|
||||
function toggleTheme(){var n=document.documentElement.getAttribute('data-theme')==='dark'?'light':'dark';document.documentElement.setAttribute('data-theme',n);try{localStorage.setItem('theme',n);}catch(e){}applyThemeIcon();}
|
||||
function applyThemeIcon(){var b=document.getElementById('theme-toggle');if(b)b.textContent=document.documentElement.getAttribute('data-theme')==='dark'?'☀ Светлая тема':'🌙 Тёмная тема';}
|
||||
document.addEventListener('DOMContentLoaded',applyThemeIcon);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -47,6 +67,7 @@ a { color: var(--accent); text-decoration: none; }
|
||||
<a href="#sessions" onclick="return showPage('sessions')">Сессии</a>
|
||||
<a href="#audit" onclick="return showPage('audit')">Журнал</a>
|
||||
<a href="#files" onclick="return showPage('files')">Файлы</a>
|
||||
<a href="#" id="theme-toggle" onclick="toggleTheme();return false">🌙 Тёмная тема</a>
|
||||
<a href="/" class="back">← Вернуться в чат</a>
|
||||
<div class="app-version" style="position:absolute;bottom:.5rem;left:1rem;font-size:.65rem;color:#999"></div>
|
||||
</nav>
|
||||
|
||||
Reference in New Issue
Block a user