From 1a39025ffb1212ae7bc2e35516798a032286c0ad Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Mon, 23 Feb 2026 19:43:35 +0000 Subject: [PATCH] Autosave: 20260223-194335 --- index.php | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 9dc0009..5cc1538 100644 --- a/index.php +++ b/index.php @@ -3778,7 +3778,12 @@ $twitter_link = "https://twitter.com/"; async function djMarkPlayed(requestId) { const username = document.getElementById('user-name').value.trim(); - if (!username) return; + if (!username) { + alert('⚠️ Por favor, ingresa tu NOMBRE en el formulario para identificarte como DJ.'); + document.getElementById('user-name').focus(); + document.getElementById('user-name').style.borderColor = '#facc15'; + return; + } try { const formData = new FormData(); @@ -3823,7 +3828,12 @@ $twitter_link = "https://twitter.com/"; async function djPrioritizeSong(requestId) { const username = document.getElementById('user-name').value.trim(); - if (!username) return; + if (!username) { + alert('⚠️ Por favor, ingresa tu NOMBRE en el formulario para identificarte como DJ.'); + document.getElementById('user-name').focus(); + document.getElementById('user-name').style.borderColor = '#facc15'; + return; + } try { const response = await fetch('api/dj_actions.php', { @@ -4624,8 +4634,12 @@ $twitter_link = "https://twitter.com/"; setInterval(fetchUpcomingTracks, 30000); setInterval(fetchActivePerks, 30000); setInterval(updateVipTimers, 1000); + + const ticTacAudio = new Audio('https://www.soundjay.com/clock/sounds/clock-ticking-2.mp3'); + ticTacAudio.volume = 0.3; function updateVipTimers() { + let shouldPlayTicTac = false; document.querySelectorAll('.vip-timer').forEach(timer => { const startStr = timer.dataset.start; if (!startStr) return; @@ -4648,6 +4662,11 @@ $twitter_link = "https://twitter.com/"; if (diff < 60) { timer.style.color = '#ff4444'; timer.classList.add('counter-alert'); + + // Tic-tac logic (last 10 seconds) + if (diff <= 10) { + shouldPlayTicTac = true; + } } else if (diff < 180) { timer.style.color = '#facc15'; timer.classList.remove('counter-alert'); @@ -4657,6 +4676,11 @@ $twitter_link = "https://twitter.com/"; } } }); + + if (shouldPlayTicTac) { + ticTacAudio.currentTime = 0; + ticTacAudio.play().catch(() => {}); + } } // Initial fetch