CSS Animation Generator
Build a keyframe animation from thirteen presets, replay it as you tune it, and copy CSS that only animates transform and opacity and respects reduced motion.
Enable JavaScript to play the animation; the CSS below is for the defaults.
Entrances fade or move in; pulse, bounce, shake and spin repeat.
200 to 500ms for an entrance. Past about 700ms an interface feels slow.
ease-out for anything entering: fast to start, settling at the end. linear only for a spin.
How far a slide, bounce or shake travels. Written as a custom property so one value drives every frame.
alternate plays forwards then backwards, which is what makes a pulse read as breathing.
both holds the first frame before it starts and the last one after: without it an entrance flashes.
Left empty it comes from the preset. Set it when the page has several animations.
@keyframes slide-up-1 {
0% {
opacity: 0;
transform: translateY(var(--distance, 24px));
}
100% {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slide-up {
0% {
opacity: 0;
transform: translateY(var(--distance, 24px));
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.animated {
--distance: 24px;
animation: 400ms cubic-bezier(0.22, 1, 0.36, 1) both slide-up;
}
@media (prefers-reduced-motion: reduce) {
.animated {
animation-duration: 1ms;
animation-iteration-count: 1;
}
}