document.addEventListener('DOMContentLoaded', () => { // Dein bestehender Nav Toggle Code const toggle = document.querySelector('.nav-toggle'); const links = document.querySelector('.nav-links'); if(toggle && links) { toggle.addEventListener('click', () => { links.classList.toggle('open'); }); links.querySelectorAll('a').forEach(link => { link.addEventListener('click', () => { if (links.classList.contains('open')) { links.classList.remove('open'); } }); }); } // QR Code erzeugen QRCode.toCanvas(document.getElementById('qrcode'), 'https://cod.devluxe.eu', { width: 180, color: { dark: '#000000', // Schwarz light: '#ffffff' // Weiß }, margin: 1 }, (error) => { if(error) console.error(error); }); // Sound Setup const hoverSound = document.getElementById('hoverSound'); const clickSound = document.getElementById('clickSound'); if(hoverSound && clickSound) { hoverSound.volume = 0.3; clickSound.volume = 0.5; let soundsEnabled = false; function enableSounds() { soundsEnabled = true; hoverSound.play().catch(() => {}); clickSound.play().catch(() => {}); document.removeEventListener('click', enableSounds); } document.addEventListener('click', enableSounds); document.querySelectorAll('a, button').forEach(el => { el.addEventListener('mouseenter', () => { if(!soundsEnabled) return; hoverSound.currentTime = 0; hoverSound.play(); }); el.addEventListener('click', () => { if(!soundsEnabled) return; clickSound.currentTime = 0; clickSound.play(); }); }); } });