57 lines
1.2 KiB
CSS
57 lines
1.2 KiB
CSS
/* container for fireworks */
|
|
.fireworks {
|
|
pointer-events: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: hidden;
|
|
z-index: 10; /* put it on top */
|
|
}
|
|
|
|
/* every firework particle */
|
|
.firework {
|
|
position: absolute;
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
background: rgba(255, 255, 255, 0.9); /* standard colors */
|
|
animation: explode 2.5s ease-out forwards, colorShift 2.5s linear infinite;
|
|
/*animation: explode 1s ease-out forwards;*/
|
|
transform-origin: center;
|
|
}
|
|
|
|
/* animation for the explosion */
|
|
@keyframes explode {
|
|
0% {
|
|
transform: scale(0.5);
|
|
opacity: 1;
|
|
}
|
|
100% {
|
|
transform: translate(var(--x), var(--y)) scale(0.4);
|
|
opacity: 0;
|
|
}
|
|
}
|
|
|
|
/* colors for the fireworks */
|
|
@keyframes colorShift {
|
|
0% {
|
|
background: rgba(255, 0, 0, 1); /* Kräftiges Rot */
|
|
}
|
|
20% {
|
|
background: rgba(0, 255, 0, 1); /* Kräftiges Grün */
|
|
}
|
|
40% {
|
|
background: rgba(0, 0, 255, 1); /* Kräftiges Blau */
|
|
}
|
|
60% {
|
|
background: rgba(255, 255, 0, 1); /* Gelb */
|
|
}
|
|
80% {
|
|
background: rgba(255, 0, 255, 1); /* Magenta */
|
|
}
|
|
100% {
|
|
background: rgba(0, 255, 255, 1); /* Türkis */
|
|
}
|
|
} |