CSS Animation Generator

Pick an animation, tune the timing, and copy complete CSS including the keyframes.

Preview

Generated CSS

Every effect here animates only transform and opacity, the two properties browsers can animate on the GPU without recalculating layout. Wrap decorative motion in @media (prefers-reduced-motion: no-preference) so it can be turned off.

About the css animation generator

Choose from common effects (fade, slide, scale, rotate, bounce, shake, pulse and more), adjust duration, delay, easing and iteration count, and watch the result loop in the preview. The output includes both the `animation` shorthand and the full `@keyframes` block, so it works with no further editing. All effects animate `transform` and `opacity` only, which are the two properties browsers can animate on the compositor without triggering layout or paint.

How to use the css animation generator

  1. Select an animation effect from the list.
  2. Adjust duration, delay, easing function and iteration count.
  3. Watch the preview loop to confirm the timing feels right.
  4. Copy the generated CSS, including the keyframes block, into your stylesheet.

Frequently asked questions

What is the difference between a transition and an animation?
A transition animates between two states and needs something to trigger the change, such as a hover or a class being added. An animation runs from a keyframe sequence on its own, can loop, and can define as many intermediate steps as you like.
Which easing function should I use?
For elements entering the screen, `ease-out` feels responsive because it starts fast. For elements leaving, `ease-in` works better. `ease-in-out` suits movement between two on-screen positions. Linear rarely looks right for anything except continuous rotation.
How do I respect users who prefer reduced motion?
Wrap decorative animation in a `@media (prefers-reduced-motion: no-preference)` query, or disable it inside `@media (prefers-reduced-motion: reduce)`. Some people experience genuine nausea from motion, and honouring the setting takes three lines.
Why is my animation stuttering?
Almost always because it animates a property that forces layout, such as `width`, `height`, `top` or `left`. Animate `transform` and `opacity` instead; browsers can handle those on the GPU without recalculating layout each frame.