-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (19 loc) · 889 Bytes
/
script.js
File metadata and controls
24 lines (19 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Countdown to Bangara's birthday: 28 July 2025
const birthdayDate = new Date("2025-07-28T00:00:00").getTime();
function updateCountdown() {
const now = new Date().getTime();
const gap = birthdayDate - now;
if (gap <= 0) {
document.querySelector('.countdown').innerHTML = "🎉 It's the Big Day! 🎉";
return;
}
const days = Math.floor(gap / (1000 * 60 * 60 * 24));
const hours = Math.floor((gap % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((gap % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((gap % (1000 * 60)) / 1000);
document.getElementById("days").textContent = days;
document.getElementById("hours").textContent = hours;
document.getElementById("minutes").textContent = minutes;
document.getElementById("seconds").textContent = seconds;
}
setInterval(updateCountdown, 1000);