Skip to content
Open
22 changes: 14 additions & 8 deletions ball/2025/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,23 @@ <h3 class="subsubtitle question">{{ qanda.question }}</h3>
(function updateTimer() {
let now = new Date().getTime();
let distance = countDownDate - now;
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById("count").innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
+ minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>";

if (distance < 0) {
document.getElementById("count").innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>";
let attendees = parseInt('{{ ball.attendees }}') || 0
if (attendees > 0) {
document.getElementById("count").innerHTML = `Attendees: ${attendees}`;
} else {
document.getElementById("count").innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>";
}
} else {
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById("count").innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
+ minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>";

setTimeout(updateTimer, 1000)
}
})();
Expand Down
22 changes: 14 additions & 8 deletions ball/2026/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,23 @@ <h3 class="subsubtitle question">{{ qanda.question }}</h3>
(function updateTimer() {
let now = new Date().getTime();
let distance = countDownDate - now;
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById("count").innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
+ minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>";

if (distance < 0) {
document.getElementById("count").innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>";
let attendees = parseInt('{{ ball.attendees }}') || 0
if (attendees > 0) {
document.getElementById("count").innerHTML = `Attendees: ${attendees}`;
} else {
document.getElementById("count").innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>";
}
} else {
let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
let seconds = Math.floor((distance % (1000 * 60)) / 1000);

document.getElementById("count").innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
+ minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>";

setTimeout(updateTimer, 1000)
}
})();
Expand Down
Loading