Update index.html
This commit is contained in:
35
index.html
35
index.html
@@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Doctor Who Season 2 Finale</title>
|
<title>Doctor Who Season 2 Finale</title>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.6.0/dist/confetti.browser.min.js"></script>
|
||||||
<style>
|
<style>
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap');
|
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500&display=swap');
|
||||||
|
|
||||||
@@ -74,20 +75,48 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<h1>Countdown to Doctor Who Season 2 Finale</h1>
|
<h1>🛸 Doctor Who Season 2 Finale</h1>
|
||||||
<div id="countdown">Loading...</div>
|
<div id="countdown">Loading...</div>
|
||||||
<div id="localTime"></div>
|
<div id="localTime"></div>
|
||||||
|
|
||||||
|
<audio id="themeMusic" preload="auto">
|
||||||
|
<source src="audio/doctor-who-remix-m1ck.wav" type="audio/wav">
|
||||||
|
Your browser does not support the audio element.
|
||||||
|
</audio>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const targetDateUTC = new Date(Date.UTC(2025, 4, 31, 17, 50, 0));
|
const targetDateUTC = new Date(Date.UTC(2025, 4, 31, 17, 50, 0));
|
||||||
|
let countdownInterval;
|
||||||
|
const audio = document.getElementById("themeMusic");
|
||||||
|
|
||||||
|
function launchConfetti() {
|
||||||
|
confetti({
|
||||||
|
particleCount: 200,
|
||||||
|
spread: 100,
|
||||||
|
origin: { y: 0.6 },
|
||||||
|
colors: ['#00ffc3', '#00d4ff', '#ffffff']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function playThemeMusic() {
|
||||||
|
const playPromise = audio.play();
|
||||||
|
if (playPromise !== undefined) {
|
||||||
|
playPromise.catch(() => {
|
||||||
|
document.body.addEventListener('click', () => audio.play(), { once: true });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function updateCountdown() {
|
function updateCountdown() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const diff = targetDateUTC - now;
|
const diff = targetDateUTC - now;
|
||||||
|
|
||||||
if (diff <= 0) {
|
if (diff <= 0) {
|
||||||
document.getElementById("countdown").textContent = "🌟 The Event Has Started!";
|
clearInterval(countdownInterval);
|
||||||
|
document.getElementById("countdown").textContent = "🎉 The episode is out — go watch now!";
|
||||||
document.getElementById("localTime").textContent = '';
|
document.getElementById("localTime").textContent = '';
|
||||||
|
launchConfetti();
|
||||||
|
playThemeMusic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +137,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateCountdown();
|
updateCountdown();
|
||||||
setInterval(updateCountdown, 1000);
|
countdownInterval = setInterval(updateCountdown, 1000);
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Reference in New Issue
Block a user