The CSS Animation Generator lets you choose a ready-made motion effect, tune its timing, and copy the keyframes and animation declaration that reproduce it. Motion guides attention, explains change, and makes an interface feel alive: a panel fades in instead of appearing abruptly, a button pulses gently to invite a click, and a form field shakes briefly to signal an error. Done well, animation is almost invisible; done badly, it distracts from everything else.
This tool keeps animation approachable by offering six named presets with clear behaviour, rather than asking you to write keyframes from scratch. Pick a preset, set the duration and delay, choose a timing function and an iteration count, and watch the preview box animate. A Replay button restarts the motion so you can judge it again, and the CSS panel shows both the keyframes block and the .animated rule that applies it.
What Is the CSS Animation Generator?
The CSS Animation Generator is a visual editor for CSS keyframe animations. It offers six presets: Fade in, Slide in, Bounce, Spin, Pulse, and Shake. Each preset has a fixed set of keyframes with a distinct name, such as ftz-fade for the fade effect and ftz-spin for rotation. The generated CSS includes the full keyframes block followed by an .animated rule that applies the animation with your chosen duration, timing function, delay, and iteration count.
Fade in moves opacity from 0 to 1, so the element appears gradually. Slide in combines a horizontal movement from 60 pixels to the left with an opacity change, so the element glides in while appearing. Bounce moves the element up by 30 pixels at the midpoint and returns it to rest, which reads as a hop. Spin rotates the element a full 360 degrees. Pulse scales the element up to 1.12 times its size at the midpoint and back, which reads as a gentle throb. Shake moves the element 8 pixels left and then 8 pixels right, which reads as a quick warning wobble.
The timing controls are duration in seconds, delay in seconds, a timing function, and an iteration count. Duration can be set from 0.1 to 10 seconds, and delay from 0 to 10 seconds. The timing functions are ease, linear, ease-in, ease-out, and ease-in-out. Iterations can be once, twice, three times, or infinite, with infinite selected by default so the preview keeps moving. Changing any control restarts the preview animation immediately, so the effect of the change is visible without pressing anything else.
- Six presets: Fade in, Slide in, Bounce, Spin, Pulse, and Shake, each with fixed keyframes.
- Duration and delay: number inputs in seconds, with step increments of 0.1 seconds.
- Timing functions: ease, linear, ease-in, ease-out, and ease-in-out.
- Iteration counts: once, twice, three times, or infinite looping.
- Replay button: restarts the preview animation on demand.
How to Use the CSS Animation Generator
Choose the motion first, then tune the timing. A good duration makes even a simple preset feel polished.
- Choose an animation preset. Use the Animation dropdown to select Fade in, Slide in, Bounce, Spin, Pulse, or Shake. The preview box starts animating with the new keyframes right away.
- Set the duration. Enter a duration in the Duration field, between 0.1 and 10 seconds. Short durations near 0.3 to 0.6 seconds suit interface feedback, while durations near 1 to 2 seconds suit decorative motion. The default is 1 second.
- Set the delay. Enter a delay between 0 and 10 seconds. The delay pauses before the animation starts, which is useful for staggering elements that should appear one after another. The default is no delay.
- Choose the timing function. Use the Timing function dropdown to select ease, linear, ease-in, ease-out, or ease-in-out. Ease starts and ends gently, linear moves at a constant speed, and the ease-in and ease-out variants favour one end of the motion.
- Choose the iteration count. Use the Iterations dropdown to select Once, Twice, 3 times, or Infinite. Use a finite count for entrances and feedback, and infinite only for ongoing indicators such as a spinner or a pulsing badge.
- Replay and judge the motion. Click Replay to restart the animation and watch it from the beginning. Pay attention to whether the motion feels too fast, too slow, or too abrupt at the start and end.
- Copy the CSS. Click Copy CSS to copy the keyframes block and the .animated rule together. Paste both into your stylesheet, and apply the animated class, or rename it, to the element you want to move.
Key Features of the CSS Animation Generator
The tool pairs each preset with the standard timing controls, so the copied code is ready to use without further editing of the keyframes.
- Named keyframes: each preset uses a distinct keyframe name, which reduces the chance of a name clash when several animations are used on one page.
- Complete output: the CSS panel includes the keyframes definition and the class rule, because an animation declaration without its keyframes does nothing.
- Fine duration steps: increments of 0.1 seconds allow precise tuning, such as a 0.4 second fade or a 1.5 second spin.
- Automatic restart: changing a setting restarts the preview, so you always see the current configuration from its beginning.
- Live preview box: a centred box labelled to invite animation, sized so rotation, scaling, and translation are all easy to see.
- Replay control: a dedicated button restarts the motion without changing any setting, which is essential for judging finite animations.
Practical Use Cases
Each preset has a natural home. Matching the motion to the meaning keeps animation helpful rather than decorative noise.
Entrances with fade and slide
Fade in suits content that should appear gently, such as a hero heading, a modal, or a newly loaded section. Slide in adds direction, which suits panels that enter from a side, notifications that arrive from an edge, and cards that appear in sequence. Use a short duration and a single iteration for entrances.
Attention with pulse
Pulse draws the eye without moving the element out of place, which suits a call-to-action button, a live indicator, or a badge showing new activity. Keep the duration near one second and consider a finite iteration count, because endless pulsing can become irritating on a page the reader stays on for a long time.
Playful feedback with bounce
Bounce suits playful interfaces, loading indicators, and elements that should feel light. A bouncing icon above a download button, or a bouncing scroll hint at the bottom of a hero, invites interaction. Use it sparingly on serious pages, where a bounce can feel out of place.
Rotation with spin
Spin is the natural motion for loaders, refresh icons, and circular indicators. A linear timing function suits spinning, because the rotation should proceed at a constant speed without easing at the start and end of each cycle. An infinite iteration count keeps the spinner turning while work is in progress.
Warnings with shake
Shake is a compact way to signal an error, such as an invalid form field or a rejected action. A single quick shake, with a short duration, reads as a warning without moving the element far. Pair it with a text message in your own code, because motion alone does not explain what went wrong.
Tips and Best Practices
Animation should serve the user, not showcase itself. These practices keep motion purposeful and comfortable.
- Keep durations short: most interface animations feel best between 0.2 and 0.8 seconds. Longer durations suit decorative elements, not controls the user is waiting on.
- Prefer finite iterations: infinite animation is right for loaders and live indicators, but most other motion should play once or a few times and then stop.
- Match the timing function to the motion: use ease-out for elements entering the screen, ease-in for elements leaving, and linear for continuous rotation.
- Respect reduced motion: some users prefer minimal animation. In your own stylesheet, consider a media query that disables or shortens animations for users who have requested reduced motion.
- Animate transform and opacity: the presets in this tool animate transform and opacity, which browsers can handle smoothly. Avoid animating layout properties such as width and height, which are more expensive.
- Test on a real device: motion that feels fine on a fast desktop may stutter on a slower phone. Check the animation on the devices your audience actually uses.
Limitations
This generator offers six fixed presets. It does not allow custom keyframes, custom percentage stops, multiple animations on one element, animation direction or fill mode controls, or different keyframe values such as a larger bounce height or a different slide distance. The distances, scales, and rotation amounts are fixed inside each preset, and only the timing values can be changed.
The output uses the class name .animated and keyframe names starting with ftz-, which you may want to rename to match your project conventions. The preview shows the animation on a single box, so it cannot show how the motion will interact with surrounding content, scrolling, or other animations on the page. Always test the copied CSS in context.
- Six fixed presets; no custom keyframes or stops.
- No direction, fill mode, or multiple-animation controls.
- Preset distances and scales are fixed.
- Output uses the .animated class; rename it if needed.
Frequently Asked Questions
Do I need to copy both parts of the output?
Yes. The keyframes block defines what the animation does at each stage, and the .animated rule applies it with your timing choices. Without the keyframes, the animation name refers to nothing and the element will not move. Copy the whole panel, including both parts.
Why does the preview keep animating forever?
The default iteration count is infinite, so the preview loops continuously. Change Iterations to Once, Twice, or 3 times if you want the motion to stop. The infinite default is useful for judging a loop, but a finite count is usually better for real interface elements.
What does the timing function change?
The timing function controls the speed curve of the animation: how quickly it starts, how it moves through the middle, and how it slows at the end. Linear moves at a constant speed. Ease starts slowly, speeds up, and slows down again. Ease-in starts slowly, ease-out ends slowly, and ease-in-out does both.
Can I change how far the slide or bounce moves?
Not in this tool. The slide distance, bounce height, pulse scale, and shake distance are fixed inside each preset. To change them, edit the keyframes values in the copied CSS by hand, keeping the same structure and percentage stops.
Will the animation work in all browsers?
The keyframes and animation syntax used here are supported by all modern browsers without prefixes. Very old browsers may need vendor prefixes, which this tool does not add. For most current projects, the copied CSS works as written.
Choosing the Right Preset for the Job
Each preset in the CSS Animation Generator carries a different meaning, and choosing well is mostly a matter of matching the motion to the message. Fade in is the most neutral option: it introduces content without implying direction or energy, which makes it the safe default for modals, tooltips, and newly loaded sections. Slide in adds a sense of arrival from a particular side, so reserve it for panels, drawers, and notifications that genuinely enter from an edge. When the direction of the slide matches the layout, such as a sidebar sliding in from the left, the motion reinforces the structure of the page.
Bounce and pulse sit at the playful end of the scale. Bounce suggests lightness and elasticity, which suits games, children’s products, and celebratory moments, but it can undermine a serious tone on a banking or legal page. Pulse is subtler: it says that something is live or waiting, without moving out of place, which is why it works for notification badges and recording indicators. Shake is the most specialised preset of all. Because it reads as a warning, it should be used only when something needs correction, such as an invalid field, and it should always be paired with a written explanation of the problem.
Spin deserves a separate note, because it is the only preset whose natural home is an ongoing process rather than a one-off event. A spinning icon promises that work is happening, and breaking that promise by leaving it spinning after the work finishes damages trust. Whenever you use spin with an infinite iteration count, make sure your code removes or hides the element when the task completes. For every other preset, a finite count is usually the kinder choice, because motion that stops lets the reader settle and focus on the content that remains.
Related Tools
These tools cover motion-adjacent styling, including loaders and transforms.
- CSS Loader Generator – build spinners, dots, bars, and pulsing loaders.
- CSS Transform Generator – set static rotation, scaling, translation, and skew.
- CSS Tooltip Generator – build hover tooltips that can appear with a fade.
- CSS Button Generator – style buttons that can carry a pulse or fade entrance.
- CSS Filter Generator – adjust blur, brightness, and colour effects on animated elements.