Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
Co-authored-by: Groq Agent <groq@noreply.143.198.27.163> Co-committed-by: Groq Agent <groq@noreply.143.198.27.163>
28 lines
767 B
JavaScript
28 lines
767 B
JavaScript
// ... existing code ...
|
|
|
|
// === AMBIENT SOUND TOGGLE ===
|
|
let ambientSound = document.getElementById('ambient-sound');
|
|
let audioToggle = document.getElementById('audio-toggle');
|
|
|
|
// Load user's audio preference
|
|
const storedMute = localStorage.getItem('nexus-ambient-muted') === 'true';
|
|
if (storedMute) {
|
|
ambientSound.muted = true;
|
|
audioToggle.classList.add('muted');
|
|
} else {
|
|
ambientSound.muted = false;
|
|
audioToggle.classList.remove('muted');
|
|
}
|
|
|
|
audioToggle.addEventListener('click', () => {
|
|
ambientSound.muted = !ambientSound.muted;
|
|
if (ambientSound.muted) {
|
|
audioToggle.classList.add('muted');
|
|
} else {
|
|
audioToggle.classList.remove('muted');
|
|
}
|
|
localStorage.setItem('nexus-ambient-muted', ambientSound.muted);
|
|
});
|
|
|
|
// ... existing code ...
|