19 lines
841 B
JavaScript
19 lines
841 B
JavaScript
|
document.addEventListener('DOMContentLoaded', function() {
|
||
|
// Set the date of the fictional Bell Riots (updated to August 30, 2024)
|
||
|
const bellRiotsDate = new Date('2024-08-30T17:00:00Z').getTime();
|
||
|
|
||
|
// Update the countdown every second
|
||
|
const countdownElement = document.getElementById('countdown');
|
||
|
setInterval(function() {
|
||
|
const now = new Date().getTime();
|
||
|
const distance = bellRiotsDate - now;
|
||
|
|
||
|
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);
|
||
|
|
||
|
countdownElement.innerHTML = `${days}d ${hours}h ${minutes}m ${seconds}s`;
|
||
|
}, 1000);
|
||
|
});
|