Autosave: 20260223-194335
This commit is contained in:
parent
30f433c6fb
commit
1a39025ffb
28
index.php
28
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user