toolqik

193 · CSS

CSS Animation Generator

Pick an animation, tune its timing and easing, and copy @keyframes ready for your site.

Runs in your browser
Aa
Options
CSS

  

About this tool

Choose an animation from the list, tune its duration, delay, easing and repeat count, and watch the preview. The generated CSS contains the @keyframes and a class that applies the animation, so you only need to add the class to an element.

How CSS animations work

@keyframes describes what changes (for example opacity from 0 to 1), and the animation property says how: which keyframes, how long, the easing curve, the delay and how often. The shorthand reads animation: name duration easing delay count direction fill-mode.

  • Fill mode both keeps the first keyframe’s styles during the delay and the last one’s after the end. Without it, a fade-in element flashes at full opacity before the animation starts.
  • Easing shapes the speed. ease-out (fast, then slow) feels natural for things entering the screen; ease-in for things leaving.
  • Direction alternate plays forwards then backwards, which suits pulsing and floating loops.

Smooth and accessible

All the presets animate only transform and opacity, which browsers can animate on the GPU without re-laying out the page, so they stay smooth on phones. With Respect reduced motion on, the CSS includes a prefers-reduced-motion block that turns the animation off for people who have asked their system for less motion, which matters for anyone with vestibular disorders.

FAQ

How do I add an animation to an element?

Copy the CSS into your stylesheet and add the class (animate by default) to the element. Adding the class with JavaScript replays it.

How do I make an animation loop?

Turn on Repeat forever, which sets animation-iteration-count: infinite. Use the alternate direction for smooth back-and-forth loops.

Why does my element flash before a fade-in?

Without animation-fill-mode: both (or backwards), the element shows its normal style during the delay. The generated CSS uses both by default.

Which properties are best to animate?

transform and opacity. They don’t trigger layout, so they animate smoothly. Animating width, height, top or margin can stutter.

What is prefers-reduced-motion?

A media query that matches when the user has asked their operating system to reduce motion. Respect it by turning off or simplifying animations.

esc
↑↓ navigate↵ open