feat: add light theme toggle

This commit is contained in:
strsv committed 2026-11-06 08:17:03 +03:00
1 parent 448e7a723d
commit 2fcb29e3fe
8 files changed
+132 -13

No files matched your search

+17
View File
@@ -5,6 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SteamBase — библиотека и рекомендации</title>
<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">
<script>
try {
if (localStorage.getItem("sb.theme") === "light") document.documentElement.dataset.theme = "light";
} catch (_) {}
</script>
<link rel="stylesheet" href="/static/styles.css">
</head>
<body>
@@ -18,6 +23,18 @@
<button class="tab" data-view="recommend">Рекомендации</button>
</nav>
<div class="stats" id="stats"></div>
<button id="themeToggle" class="icon-btn theme-toggle" type="button"
title="Светлая тема" aria-label="Переключить тему" aria-pressed="false">
<svg class="icon-sun" viewBox="0 0 24 24" width="16" height="16" fill="none"
stroke="currentColor" stroke-width="1.8" stroke-linecap="round">
<circle cx="12" cy="12" r="4"/>
<path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>
</svg>
<svg class="icon-moon" viewBox="0 0 24 24" width="16" height="16" fill="none"
stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"/>
</svg>
</button>
</header>
<div id="filtersBackdrop" class="filters-backdrop" hidden></div>