Обновить 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>
|
||||
<button class="theme-toggle" onclick="toggleTheme()" title="Переключить тему">🌓</button>
|
||||
<script>
|
||||
function toggleTheme() {
|
||||
function toggleTheme() {{
|
||||
document.body.classList.toggle('dark-mode');
|
||||
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');
|
||||
}
|
||||
}}
|
||||
</script>
|
||||
</body>
|
||||
</html>"""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user