Spaces:
Running
Running
// Target date here (Year, Month (0-11), Day, Hour, Minute) | |
const targetDate = new Date("2026-01-01T08:00:00Z"); // UTC time | |
function updateCountdown() { | |
const now = new Date(); | |
const diff = targetDate - now; | |
if (diff <= 0) { | |
document.getElementById("countdown").innerHTML = "<h2>🚀 Launched!</h2>"; | |
return; | |
} | |
const days = Math.floor(diff / (1000 * 60 * 60 * 24)); | |
const hours = Math.floor((diff / (1000 * 60 * 60)) % 24); | |
const minutes = Math.floor((diff / (1000 * 60)) % 60); | |
const seconds = Math.floor((diff / 1000) % 60); | |
document.getElementById("days").textContent = String(days).padStart(2, '0'); | |
document.getElementById("hours").textContent = String(hours).padStart(2, '0'); | |
document.getElementById("minutes").textContent = String(minutes).padStart(2, '0'); | |
document.getElementById("seconds").textContent = String(seconds).padStart(2, '0'); | |
} | |
setInterval(updateCountdown, 1000); | |
updateCountdown(); | |
const audio = document.getElementById("backgroundSound"); | |
if (audio) { | |
audio.volume = 1.00; // Set volume immediately when script loads | |
} | |
window.addEventListener('click', () => { | |
if (audio && audio.paused) { | |
audio.play().catch((e) => console.log("Audio autoplay blocked:", e)); | |
} | |
}, { once: true }); | |