mirror of
https://github.com/LucasVbr/nuitdelinfo-2023.git
synced 2026-05-19 10:53:17 +00:00
pour toi loulou2
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
let score = 0;
|
||||
|
||||
function augmenterCompteur() {
|
||||
score++;
|
||||
handleScore()
|
||||
}
|
||||
|
||||
function handleScore() {
|
||||
const total = 25;
|
||||
const categories_step = 5;
|
||||
const starsId = [
|
||||
"star1",
|
||||
"star2",
|
||||
"star3",
|
||||
"star4",
|
||||
"star5",
|
||||
]
|
||||
|
||||
let starElements = starsId.map(id => document.getElementById(id));
|
||||
for(let i = 0; i < starElements.length; i++) {
|
||||
if (score >= (i + 1) * categories_step) {
|
||||
starElements[i].style.visibility = 'visible';
|
||||
}
|
||||
}
|
||||
|
||||
if (score === total) window.location.href = './easterEggEtoile.html';
|
||||
}
|
||||
Reference in New Issue
Block a user