feat: кнопка день/ночь
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user