// Random flickering effect for horror atmosphere document.addEventListener('DOMContentLoaded', () => { // Randomly add flicker class to elements const elements = document.querySelectorAll('.bg-dark-800, .bg-dark-700'); elements.forEach(el => { if (Math.random() > 0.7) { el.classList.add('flicker'); } }); // Random creepy sound effect on page load (33% chance) if (Math.random() > 0.66) { const sounds = [ 'https://assets.mixkit.co/sfx/preview/mixkit-creepy-laugh-1315.mp3', 'https://assets.mixkit.co/sfx/preview/mixkit-horror-laugh-1386.mp3', 'https://assets.mixkit.co/sfx/preview/mixkit-light-breath-1542.mp3' ]; const randomSound = sounds[Math.floor(Math.random() * sounds.length)]; const audio = new Audio(randomSound); audio.volume = 0.3; audio.play(); } });