diff --git a/css/index.css b/css/index.css index 375bdba..a9f06be 100644 --- a/css/index.css +++ b/css/index.css @@ -23,34 +23,31 @@ } - /* Define keyframes for the confetti */ - @keyframes confettiFall { +@keyframes PluieConfetti { 0% { - transform: translateY(-100px) rotate(0deg); - opacity: 1; + transform: translateY(-100px) rotate(0deg); + opacity: 1; } 100% { - transform: translateY(100vh) rotate(720deg); - opacity: 0; + transform: translateY(100vh) rotate(720deg); + opacity: 0; } - } +} - /* Confetti styles */ - .confetti { +.confetti { position: absolute; width: 10px; height: 20px; - animation: confettiFall 5s linear; + animation: confettiFall 5s linear infinite; opacity: 0; - } +} - /* Confetti container to spawn confetti randomly */ - .confetti-container { +.confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; - pointer-events: none; /* Prevent interaction */ - } \ No newline at end of file + pointer-events: none; /* pour ne pas interagir avec les confettis */ +} \ No newline at end of file diff --git a/js/main.js b/js/main.js index 3ef8e74..f51619f 100644 --- a/js/main.js +++ b/js/main.js @@ -219,7 +219,7 @@ async function remplirMagasinCollegues(){ // on ajoute l'amélioration dans l'abre des compétences débloquées sacado[key] = 1 - + // on change le futur cout dans le tableau document.getElementById("case_cout_"+key).innerText = Number(c.cout * (1.1)**sacado[key]).toFixed(1) @@ -310,7 +310,7 @@ function genererConfetti() { // couleurs des confetti à generer const colors = ["#FF5733", "#33FF57", "#3357FF", "#FF33A1", "#FFD633", "#A833FF", "#33FFF6"] - const nb_confetti = 50 // nombre de confettis + const nb_confetti = 150 // nombre de confettis for (let i = 0; i < nb_confetti; i++) { @@ -336,7 +336,9 @@ function genererConfetti() { } - // vide le conteneur à la fin pour ne pas surcharger la page d'elements + setTimeout(() => { + // vide le conteneur à la fin pour ne pas surcharger la page d'elements + container.innerHTML = "" + }, 10000); - container.innerHTML = "" } \ No newline at end of file