feat(страницы): тот же переключатель темы на ценах, политике, условиях, оплате и статистике; на телефоне — внизу справа
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -286,5 +286,26 @@ async function load() {
|
||||
}
|
||||
load();
|
||||
</script>
|
||||
<!-- Переключатель темы — тот же на всех страницах (сказал Хозяин 18.11) -->
|
||||
<style>
|
||||
#theme-fab { position: fixed; top: .8rem; right: .8rem; width: 38px; height: 38px; border-radius: 50%;
|
||||
border: 1.5px solid var(--border, #ddd0bf); background: var(--card, var(--bg-card, #fff));
|
||||
color: var(--text, #2b2926); cursor: pointer; font-size: 1rem; line-height: 1; z-index: 50; }
|
||||
@media (max-width: 640px) { #theme-fab { top: auto; bottom: .9rem; right: .9rem; } }
|
||||
</style>
|
||||
<button id="theme-fab" onclick="toggleTheme()" title="Светлая / тёмная тема" aria-label="Переключить тему">☾</button>
|
||||
<script>
|
||||
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-fab');
|
||||
if (b) b.textContent = document.documentElement.getAttribute('data-theme') === 'dark' ? '☀' : '☾';
|
||||
}
|
||||
applyThemeIcon();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user