ptit flop
This commit is contained in:
parent
2aa25f13d3
commit
a3f77dc11d
2 changed files with 18 additions and 19 deletions
|
@ -23,8 +23,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Define keyframes for the confetti */
|
@keyframes PluieConfetti {
|
||||||
@keyframes confettiFall {
|
|
||||||
0% {
|
0% {
|
||||||
transform: translateY(-100px) rotate(0deg);
|
transform: translateY(-100px) rotate(0deg);
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -35,16 +34,14 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Confetti styles */
|
|
||||||
.confetti {
|
.confetti {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
animation: confettiFall 5s linear;
|
animation: confettiFall 5s linear infinite;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Confetti container to spawn confetti randomly */
|
|
||||||
.confetti-container {
|
.confetti-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -52,5 +49,5 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
pointer-events: none; /* Prevent interaction */
|
pointer-events: none; /* pour ne pas interagir avec les confettis */
|
||||||
}
|
}
|
|
@ -310,7 +310,7 @@ function genererConfetti() {
|
||||||
// couleurs des confetti à generer
|
// couleurs des confetti à generer
|
||||||
const colors = ["#FF5733", "#33FF57", "#3357FF", "#FF33A1", "#FFD633", "#A833FF", "#33FFF6"]
|
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++) {
|
for (let i = 0; i < nb_confetti; i++) {
|
||||||
|
|
||||||
|
@ -336,7 +336,9 @@ function genererConfetti() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
// vide le conteneur à la fin pour ne pas surcharger la page d'elements
|
// vide le conteneur à la fin pour ne pas surcharger la page d'elements
|
||||||
|
|
||||||
container.innerHTML = ""
|
container.innerHTML = ""
|
||||||
|
}, 10000);
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue