diff --git a/ball/2025/index.html b/ball/2025/index.html index 9d6d5d26..b44b2a0a 100644 --- a/ball/2025/index.html +++ b/ball/2025/index.html @@ -104,17 +104,23 @@

{{ qanda.question }}

(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 + " days " + hours + " hours " - + minutes + " minutes " + seconds + " seconds"; if (distance < 0) { - document.getElementById("count").innerHTML = "cssbham.com/join"; + let attendees = parseInt('{{ ball.attendees }}') || 0 + if (attendees > 0) { + document.getElementById("count").innerHTML = `Attendees: ${attendees}`; + } else { + document.getElementById("count").innerHTML = "cssbham.com/join"; + } } 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 + " days " + hours + " hours " + + minutes + " minutes " + seconds + " seconds"; + setTimeout(updateTimer, 1000) } })(); diff --git a/ball/2026/index.html b/ball/2026/index.html index 6b0b9882..b358888a 100644 --- a/ball/2026/index.html +++ b/ball/2026/index.html @@ -104,17 +104,23 @@

{{ qanda.question }}

(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 + " days " + hours + " hours " - + minutes + " minutes " + seconds + " seconds"; if (distance < 0) { - document.getElementById("count").innerHTML = "cssbham.com/join"; + let attendees = parseInt('{{ ball.attendees }}') || 0 + if (attendees > 0) { + document.getElementById("count").innerHTML = `Attendees: ${attendees}`; + } else { + document.getElementById("count").innerHTML = "cssbham.com/join"; + } } 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 + " days " + hours + " hours " + + minutes + " minutes " + seconds + " seconds"; + setTimeout(updateTimer, 1000) } })();