A worked example, rendered from real sample data. Sign in to run the tool on your own input.
confetti.particle-field {
position: relative;
overflow: hidden;
isolation: isolate;
--p-size: 10px;
}
.particle {
position: absolute;
top: 0;
width: var(--p-size);
height: var(--p-size);
border-radius: 2px; width: calc(var(--p-size) * 0.45);
animation: particle-move 4s linear infinite;
will-change: transform, opacity;
pointer-events: none;
}
@keyframes particle-move {
0% { transform: translate3d(0, -20%, 0) rotate(0) scale(var(--p-scale)); opacity: 1; }
100% { transform: translate3d(var(--p-drift), 120%, 0) rotate(720deg) scale(var(--p-scale)); opacity: 0; }
}
.particle:nth-child(1) { left: 84.8%; animation-delay: -1.95s; animation-duration: 4.19s; --p-drift: -39px; --p-scale: 1.22; background: #3b82f6; }
.particle:nth-child(2) { left: 23.5%; animation-delay: -2.26s; animation-duration: 2.73s; --p-drift: 16px; --p-scale: 0.81; background: #3b82f6; }
.particle:nth-child(3) { left: 23.5%; animation-delay: -1.37s; animation-duration: 5.48s; --p-drift: -54px; --p-scale: 1.28; background: #ec4899; }
.particle:nth-child(4) { left: 55.1%; animation-delay: -3.26s; animation-duration: 2.97s; --p-drift: -33px; --p-scale: 1; background: #3b82f6; }
.particle:nth-child(5) { left: 17.2%; animation-delay: -3.73s; animation-duration: 4.93s; --p-drift: 41px; --p-scale: 0.58; background: #3b82f6; }
.particle:nth-child(6) { left: 62.2%; animation-delay: -2.83s; animation-duration: 3.26s; --p-drift: -5px; --p-scale: 1.4; background: #ec4899; }
.particle:nth-child(7) { left: 14%; animation-delay: -2.74s; animation-duration: 4.41s; --p-drift: -33px; --p-scale: 0.97; backgroun
…
Generate CSS-only particle animations (confetti, snow, stars). Part of the DevTools Surf developer suite. Browse more tools in the Animation / CSS collection.