This repository has been archived on 2025-05-16. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
pi-race-timer/app/static/js/main.js
2025-04-30 00:26:28 +02:00

31 lines
804 B
JavaScript

function startCountdown() {
const beep = new Audio("/static/sounds/beep.wav");
const go = new Audio("/static/sounds/go.wav");
setTimeout(() => {
document.getElementById("licht1").classList.add("aktiv");
beep.play();
}, 1000);
setTimeout(() => {
document.getElementById("licht2").classList.add("aktiv");
beep.play();
}, 2000);
setTimeout(() => {
document.getElementById("licht3").classList.add("aktiv");
beep.play();
}, 3000);
setTimeout(() => {
document.querySelectorAll(".licht").forEach(el => {
el.classList.remove("rot");
el.classList.add("gruen");
});
go.play();
}, 4000);
setTimeout(() => {
window.location.href = "/rennansicht";
}, 7000);
}