About the CSS Animation Generator tool
A well-chosen animation makes an interface feel responsive: a card that fades in, a notification that bounces, a button that pulses to draw attention or a loader that spins. CSS animations need no JavaScript, but you have to write @keyframes rules and an animation shorthand with seven values in the right order, then keep reloading to see how it feels.
This CSS animation generator comes with fifteen ready-made presets including fade in and out, slide in from the left, right or bottom, bounce, pulse, shake, spin, zoom in and out, flip, swing, heartbeat and wobble. Adjust the duration and delay with sliders, choose a timing function such as ease, linear or an overshooting cubic-bezier, set the iteration count or infinite, pick the direction and fill mode, and watch the preview update.
The keyframes are fully editable, so you can use a preset as a starting point and write your own steps. The output includes the @keyframes block, the animation shorthand on an .animated class and a prefers-reduced-motion rule that disables the animation for users who have asked for less motion.
How to use CSS Animation Generator
- Click a “Preset” such as bounce, fadeIn or spin.
- Set “Duration” and “Delay” with the sliders.
- Choose the “Timing function”, “Direction”, “Fill mode” and “Iterations”.
- Optionally edit the “Keyframes (editable)” box and animation name.
- Click “Replay” to watch it again, then copy the CSS.
Features
15 animation presets
Entrance, exit, attention and looping effects ready to use.
All animation properties
Duration, timing function, delay, iteration count, direction and fill mode.
Editable keyframes
Change or write your own keyframe steps and see them in the preview.
Replay control
Restart one-shot animations like fade and zoom to check them again.
Reduced-motion aware
Output includes a prefers-reduced-motion media query.
When to use it
- Add a fade-in-up entrance to cards as a page loads.
- Make a notification badge pulse or shake to attract attention.
- Create a spinning loading icon without an image.
- Prototype micro-interactions before implementing them in a framework.
- Learn how timing functions and fill modes change an animation.
Frequently asked questions
What is the order of values in the animation shorthand?
A common order is name, duration, timing function, delay, iteration count, direction and fill mode. The first time value is always the duration and the second is the delay.
What does animation-fill-mode forwards do?
It keeps the styles from the last keyframe after the animation finishes, so a faded-in element stays visible instead of snapping back.
Are CSS animations better than JavaScript animations?
For simple transitions, CSS is easier and animating transform and opacity is very efficient. JavaScript is better for animations that depend on user input or physics.
Why respect prefers-reduced-motion?
Some people get dizzy or nauseous from motion. The media query lets you remove or tone down animations for users who enabled that operating system setting.
How do I trigger the animation on scroll?
Add the animated class with a small IntersectionObserver script when the element enters the viewport, or use CSS scroll-driven animations in browsers that support them.