31 lines
799 B
JavaScript
31 lines
799 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 = "/rennen";
|
|
}, 7000);
|
|
}
|