potain/jeux/assets/jeu.js

19 lines
560 B
JavaScript
Raw Normal View History

2021-06-04 23:11:15 +02:00
let timeout;
function win() {
clearTimeout(timeout);
document.querySelector(".failure").classList.add("hidden");
document.querySelector(".success").classList.remove("hidden");
2021-06-05 17:13:34 +02:00
document.querySelector(".success-stamp").classList.remove("hidden");
2021-06-04 23:11:15 +02:00
}
function lose() {
clearTimeout(timeout);
document.querySelector(".success").classList.add("hidden");
let failure = document.querySelector(".failure");
failure.classList.remove("hidden");
timeout = setTimeout(() => {
failure.classList.add("hidden");
}, 5*1000);
}