Create script.js
Browse files
script.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Set your target date here (Year, Month (0-11), Day, Hour, Minute)
|
| 2 |
+
const targetDate = new Date("2025-06-14T9:00:00Z"); // UTC time
|
| 3 |
+
|
| 4 |
+
function updateCountdown() {
|
| 5 |
+
const now = new Date();
|
| 6 |
+
const diff = targetDate - now;
|
| 7 |
+
|
| 8 |
+
if (diff <= 0) {
|
| 9 |
+
document.getElementById("countdown").innerHTML = "<h2>🚀 Launched!</h2>";
|
| 10 |
+
return;
|
| 11 |
+
}
|
| 12 |
+
|
| 13 |
+
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
| 14 |
+
const hours = Math.floor((diff / (1000 * 60 * 60)) % 24);
|
| 15 |
+
const minutes = Math.floor((diff / (1000 * 60)) % 60);
|
| 16 |
+
const seconds = Math.floor((diff / 1000) % 60);
|
| 17 |
+
|
| 18 |
+
document.getElementById("days").textContent = String(days).padStart(2, '0');
|
| 19 |
+
document.getElementById("hours").textContent = String(hours).padStart(2, '0');
|
| 20 |
+
document.getElementById("minutes").textContent = String(minutes).padStart(2, '0');
|
| 21 |
+
document.getElementById("seconds").textContent = String(seconds).padStart(2, '0');
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
setInterval(updateCountdown, 1000);
|
| 25 |
+
updateCountdown();
|