feat: кнопка день/ночь

This commit is contained in:
2026-06-01 23:09:58 +03:00
parent 55fb1f658b
commit 3929c07e8e
2 changed files with 29 additions and 1 deletions
+11
View File
@@ -25,6 +25,7 @@
<button id="btnRecord">🎙 Записать</button>
<button id="btnPlay" disabled>▶ Прослушать</button>
<button id="btnReset">🗑 Сброс</button>
<button id="btnTheme" title="День/Ночь">🌙</button>
</div>
<div id="status"></div>
@@ -228,6 +229,16 @@
document.getElementById('btnReset').onclick = () => {
chatHistory = []; chat.innerHTML = ''; setStatus('🧹 Очищено');
};
// Тема
const btnTheme = document.getElementById('btnTheme');
let dark = localStorage.getItem('say_dark') !== '0';
function applyTheme() {
document.body.className = dark ? 'dark' : 'light';
btnTheme.textContent = dark ? '🌙' : '☀️';
}
applyTheme();
btnTheme.onclick = () => { dark = !dark; localStorage.setItem('say_dark', dark ? '1' : '0'); applyTheme(); };
</script>
</body>
</html>