Files
Seasonals-Fireworks/fireworks.css
2024-11-29 00:50:01 +01:00

73 lines
1.3 KiB
CSS

/* container for fireworks */
.fireworks {
pointer-events: none;
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
overflow: hidden;
z-index: 10; /* put it on top */
}
/* every firework particle */
.firework {
position: absolute;
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--color);
animation: move 2.5s ease-out, fadeOut 2.5s ease-out, shrink 2.5s ease-out;
/*animation: explode 2.5s ease-out forwards, colorShift 2.5s linear infinite;*/
transform-origin: center;
}
/* every rocket */
.rocket {
position: absolute;
width: 4px;
height: 20px;
background: var(--color);
border-radius: 2px;
animation: rise 1s ease-out;
}
/* movement of particles */
@keyframes move {
from {
transform: translate(0, 0);
}
to {
transform: translate(var(--x), var(--y));
}
}
/* fadeout of particles */
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
/* shrinking of particles */
@keyframes shrink {
from {
transform: scale(1);
}
to {
transform: scale(0.5);
}
}
/* movement of rockets */
@keyframes rise {
from {
transform: translate(0, 100vh);
}
to {
transform: translate(0, var(--y));
}
}