const targetDate = new Date("2026-09-18T16:00:00").getTime(); const daysEl = document.getElementById("days"); const hoursEl = document.getElementById("hours"); const minutesEl = document.getElementById("minutes"); const secondsEl = document.getElementById("seconds"); const messageEl = document.getElementById("message"); const countdownEl = document.getElementById("countdown"); const updateCountdown = () => { const now = new Date().getTime(); const distance = targetDate - now; if (distance <= 0) { clearInterval(interval); countdownEl.style.display = "none"; messageEl.style.display = "block"; 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); daysEl.textContent = days; hoursEl.textContent = hours; minutesEl.textContent = minutes; secondsEl.textContent = seconds; }; const interval = setInterval(updateCountdown, 1000); updateCountdown(); // initial call