Rename static/js/countdown.js to static/js/message.js
Browse files- static/js/countdown.js +0 -21
- static/js/message.js +4 -0
static/js/countdown.js
DELETED
@@ -1,21 +0,0 @@
|
|
1 |
-
document.addEventListener('DOMContentLoaded', () => {
|
2 |
-
const countdownElement = document.getElementById('countdown');
|
3 |
-
|
4 |
-
async function updateCountdown() {
|
5 |
-
try {
|
6 |
-
const response = await fetch('/countdown');
|
7 |
-
const data = await response.json();
|
8 |
-
const daysLeft = data.days;
|
9 |
-
countdownElement.innerHTML = `${daysLeft} days until Manavi’s birthday on April 19, 2025!`;
|
10 |
-
} catch (error) {
|
11 |
-
console.error('Error fetching countdown:', error);
|
12 |
-
countdownElement.innerHTML = 'Error loading countdown—try again later!';
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
// Initial update
|
17 |
-
updateCountdown();
|
18 |
-
|
19 |
-
// Update every minute
|
20 |
-
setInterval(updateCountdown, 60000);
|
21 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static/js/message.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// static/js/message.js
|
2 |
+
document.addEventListener('DOMContentLoaded', function () {
|
3 |
+
console.log('Birthday Message page loaded');
|
4 |
+
});
|