Download script.js from NeuraLake/countdown: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/spaces/NeuraLake/countdown/resolve/main/script.js
- Command line
-
hf download hf://spaces/NeuraLake/countdown/script.js
-
curl -L -o script.js https://huggingface.co/spaces/NeuraLake/countdown/resolve/main/script.js
1.26 kB
| // Target date here (Year, Month (0-11), Day, Hour, Minute) | |
| const targetDate = new Date("2025-06-14T07: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 = 0.05; // 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 }); | |