Обновить build.py
This commit is contained in:
parent
5860734e2f
commit
c997844856
8
build.py
8
build.py
@ -58,14 +58,14 @@ TEMPLATE = """<!DOCTYPE html>
|
|||||||
</footer>
|
</footer>
|
||||||
<button class="theme-toggle" onclick="toggleTheme()" title="Переключить тему">🌓</button>
|
<button class="theme-toggle" onclick="toggleTheme()" title="Переключить тему">🌓</button>
|
||||||
<script>
|
<script>
|
||||||
function toggleTheme() {
|
function toggleTheme() {{
|
||||||
document.body.classList.toggle('dark-mode');
|
document.body.classList.toggle('dark-mode');
|
||||||
localStorage.setItem('theme', document.body.classList.contains('dark-mode') ? 'dark' : 'light');
|
localStorage.setItem('theme', document.body.classList.contains('dark-mode') ? 'dark' : 'light');
|
||||||
}
|
}}
|
||||||
// Восстановление темы при загрузке
|
// Восстановление темы при загрузке
|
||||||
if (localStorage.getItem('theme') === 'dark') {
|
if (localStorage.getItem('theme') === 'dark') {{
|
||||||
document.body.classList.add('dark-mode');
|
document.body.classList.add('dark-mode');
|
||||||
}
|
}}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>"""
|
</html>"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user