CSS Animation Generator
Visually build complex CSS keyframe animations with instant live preview. Choose from presets or customize timings and behavior.
.animate-bounce {
animation: bounce 1s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-30px); }
60% { transform: translateY(-15px); }
}About the CSS Animation Generator
Choose an animation preset, set the iteration count, watch the live preview and copy the @keyframes and animation CSS.
Everything you enter is processed in your browser; nothing is uploaded or stored.
How to use it
- Choose a preset type, such as bounce, shake or fade.
- Set the iteration: Infinite, Once or Twice.
- Copy the CSS code and add the class to your element.
How CSS keyframe animations work
@keyframes defines the steps of the motion (for example transform: translateY(-20px) at 50%). The animation property attaches it to an element with a duration, timing function and iteration count.
Animating transform and opacity is cheap for the browser because it can hand the work to the GPU, which keeps animations smooth; animating width, height or top causes layout work and can stutter.
Tips
- Respect users who prefer less motion: wrap animations in @media (prefers-reduced-motion: no-preference).
- Use Once for attention cues; Infinite loops quickly become distracting.
Frequently asked questions
How do I run an animation only once?
Set animation-iteration-count: 1 (the Once option).
How do I trigger the animation on hover?
Put the animation property inside a :hover rule.
Do CSS animations work without JavaScript?
Yes, they are pure CSS.