Task tracker for my work session tonight. for example ingrahm data studio completion, Birdy Zoom Update, Aria Number Parking, M1 Presentation and questions tomorrow
5118953 verified Download script.js from CEOSamaltman/countdown-carnival-counters: direct link, hf CLI and curl.
- Browser
- Download file 2.24 kB
-
https://huggingface.co/spaces/CEOSamaltman/countdown-carnival-counters/resolve/main/script.js
- Command line
-
hf download hf://spaces/CEOSamaltman/countdown-carnival-counters/script.js
-
curl -L -o script.js https://huggingface.co/spaces/CEOSamaltman/countdown-carnival-counters/resolve/main/script.js
2.24 kB
| // Initialize countdown timers | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // New Year's Eve timer (December 31, 2024) | |
| initializeCountdown('timer1', new Date('December 31, 2024 23:59:59').getTime()); | |
| // Summer Vacation timer (June 15, 2024) | |
| initializeCountdown('timer2', new Date('June 15, 2024 00:00:00').getTime()); | |
| // Birthday Bash timer (August 20, 2024) | |
| initializeCountdown('timer3', new Date('August 20, 2024 00:00:00').getTime()); | |
| // Form submission for new timers | |
| document.getElementById('timerForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| const eventName = document.getElementById('eventName').value; | |
| const eventDate = new Date(document.getElementById('eventDate').value).getTime(); | |
| if (eventName && !isNaN(eventDate)) { | |
| alert(`New countdown created for "${eventName}"!`); | |
| document.getElementById('timerForm').reset(); | |
| } else { | |
| alert('Please enter valid event name and date!'); | |
| } | |
| }); | |
| }); | |
| function initializeCountdown(id, endDate) { | |
| const timerElement = document.getElementById(id); | |
| function updateTimer() { | |
| const now = new Date().getTime(); | |
| const distance = endDate - now; | |
| if (distance < 0) { | |
| clearInterval(countdown); | |
| timerElement.innerHTML = "EVENT TIME!"; | |
| return; | |
| } | |
| const days = Math.floor(distance / (1000 * 60 * 60 * 24)); | |
| const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); | |
| const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); | |
| const seconds = Math.floor((distance % (1000 * 60)) / 1000); | |
| timerElement.querySelector('.days').textContent = days.toString().padStart(2, '0'); | |
| timerElement.querySelector('.hours').textContent = hours.toString().padStart(2, '0'); | |
| timerElement.querySelector('.minutes').textContent = minutes.toString().padStart(2, '0'); | |
| timerElement.querySelector('.seconds').textContent = seconds.toString().padStart(2, '0'); | |
| } | |
| updateTimer(); | |
| const countdown = setInterval(updateTimer, 1000); | |
| } |