diff --git a/index.php b/index.php index ed43773..a1567b5 100644 --- a/index.php +++ b/index.php @@ -3089,6 +3089,61 @@ $twitter_link = "https://twitter.com/"; } } + let globalReactionCount = 0; + let lastMassiveCelebration = 0; + let reactionTimer = null; + + function triggerMassiveCelebration() { + const duration = 10 * 1000; + const animationEnd = Date.now() + duration; + const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: 10001 }; + + function randomInRange(min, max) { + return Math.random() * (max - min) + min; + } + + const interval = setInterval(function() { + const timeLeft = animationEnd - Date.now(); + + if (timeLeft <= 0) { + return clearInterval(interval); + } + + const particleCount = 40 * (timeLeft / duration); + confetti(Object.assign({}, defaults, { particleCount, origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 } })); + confetti(Object.assign({}, defaults, { particleCount, origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 } })); + }, 250); + + // Visual feedback text + const banner = document.createElement('div'); + banner.style.position = 'fixed'; + banner.style.top = '50%'; + banner.style.left = '50%'; + banner.style.transform = 'translate(-50%, -50%)'; + banner.style.zIndex = '10002'; + banner.style.textAlign = 'center'; + banner.style.pointerEvents = 'none'; + banner.style.animation = 'fadeIn 0.5s forwards'; + banner.innerHTML = ` +
¡LA RADIO ESTÁ EXPLOTANDO! 🔥🎉
+ `; + document.body.appendChild(banner); + + // Play a sound if possible (recycling the DJ power sound) + const powerSound = document.getElementById('dj-power-sound'); + if (powerSound) { + powerSound.currentTime = 0; + powerSound.play().catch(() => {}); + } + + setTimeout(() => { + banner.style.transition = 'opacity 1s ease'; + banner.style.opacity = '0'; + setTimeout(() => banner.remove(), 1000); + }, 5000); + } + function spawnReactionEmoji(emoji) { const container = document.body; const emojiEl = document.createElement('div'); @@ -3107,6 +3162,26 @@ $twitter_link = "https://twitter.com/"; container.appendChild(emojiEl); setTimeout(() => { emojiEl.remove(); }, duration * 1000); + + // Massive Celebration Logic + globalReactionCount++; + + if (!reactionTimer) { + reactionTimer = setTimeout(() => { + globalReactionCount = 0; + reactionTimer = null; + }, 10000); // 10 second window + } + + if (globalReactionCount >= 50 && (Date.now() - lastMassiveCelebration > 30000)) { + triggerMassiveCelebration(); + globalReactionCount = 0; + lastMassiveCelebration = Date.now(); + if (reactionTimer) { + clearTimeout(reactionTimer); + reactionTimer = null; + } + } } async function sendReaction(emoji) {