PureDevTools

CSS Animation Generator

Visually build CSS @keyframes animations — keyframe editor, easing selector, live preview, one-click copy

All processing happens in your browser. No data is sent to any server.

Presets

Timing

1s
0s

Iteration Count

Easing & Playback

Keyframe Stops (3)

0%
transform: translateX(0) scale(1); opacity: 1
50%
transform: translateX(50px) scale(1.2); opacity: 0.7
100%
transform: translateX(0) scale(1); opacity: 1

Edit Keyframe at 0%

Live Preview

The purple square animates using your exact generated CSS

Generated CSS

@keyframes my-animation { 0% { transform: translateX(0) scale(1); opacity: 1; } 50% { transform: translateX(50px) scale(1.2); opacity: 0.7; } 100% { transform: translateX(0) scale(1); opacity: 1; } } .animated-element { animation-name: my-animation; animation-duration: 1s; animation-timing-function: ease; animation-delay: 0s; animation-iteration-count: infinite; animation-direction: normal; animation-fill-mode: none; }

More Formats

@keyframes block only
@keyframes my-animation { 0% { transform: translateX(0) scale(1); opacity: 1; } 50% { transform: translateX(50px) scale(1.2); opacity: 0.7; } 100% { transform: translateX(0) scale(1); opacity: 1; } }
animation shorthand
animation: my-animation 1s ease 0s infinite normal none;

You need a card entrance animation — slide in from the left, fade in, and stop at the final position. That’s three CSS properties (transform, opacity, animation-fill-mode) across two keyframe stops, plus the timing function, duration, delay, and iteration count. Writing it by hand means guessing at cubic-bezier values, refreshing to check, tweaking, refreshing again. And if you need the animation to stagger across a list of cards, you’re doing mental math on animation-delay offsets.

Why This Tool (Not DevTools or Copy-Paste from Animate.css)

Animate.css gives you pre-built animations with great naming (fadeInLeft, bounceIn), but customizing them means forking the library or overriding timing in your own stylesheet. Chrome DevTools has an animation inspector for debugging, but no way to build new animations from scratch. This tool lets you add keyframe stops on a visual timeline, set per-stop transforms and opacity, pick easing curves, and watch the result animate in real time — then copy the exact @keyframes block + animation shorthand. Everything runs in your browser; no data is sent to any server.

What Is a CSS Animation?

A CSS animation is defined by two things: a @keyframes rule that describes what properties change at each point in time, and the animation property on the element that ties it all together.

How to Use This Tool

  1. Choose a preset — start from a built-in animation (Fade In, Bounce, Spin, Pulse, Slide In, Color Shift) or build from scratch
  2. Set the animation name — this becomes the @keyframes identifier and the animation-name value
  3. Add or remove keyframe stops — each stop represents a percentage of the animation timeline (0% to 100%)
  4. Edit per-keyframe properties — set transform, opacity, background-color, or any extra CSS for each stop
  5. Configure timing — adjust duration, delay, iteration count, direction, and fill-mode
  6. Pick an easing function — choose from ease, linear, ease-in, ease-out, ease-in-out, or a custom cubic-bezier()
  7. Watch the live preview — the sample element animates in real time using your exact CSS
  8. Copy the output — copy the generated @keyframes block + animation properties with one click

@keyframes Explained

The @keyframes rule defines the animation sequence. Each selector inside it is a keyframe stop — a snapshot of CSS properties at a specific point in time:

@keyframes slide-in {
  0% {
    transform: translateX(-100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

You can use from and to as aliases for 0% and 100%, or any percentage in between. Browsers interpolate the property values between stops.

The animation Property

The animation shorthand applies a @keyframes animation to an element:

.element {
  animation: slide-in 0.4s ease-out 0s 1 normal forwards;
}
Sub-propertyExampleDescription
animation-nameslide-inMatches the @keyframes name
animation-duration0.4sHow long one cycle takes
animation-timing-functionease-outSpeed curve within each cycle
animation-delay0sWait before starting
animation-iteration-count1 or infiniteHow many times to repeat
animation-directionnormal, reverse, alternatePlay direction
animation-fill-modeforwards, backwards, both, noneState before/after animation

Easing Functions

The animation-timing-function controls the rate of change between keyframe stops:

ValueEffect
easeSlow start, fast middle, slow end (default)
linearConstant speed throughout
ease-inSlow start, accelerates at end
ease-outFast start, decelerates at end
ease-in-outSlow at both ends
cubic-bezier(x1, y1, x2, y2)Custom speed curve

Tip: Use linear for continuous rotations so the motion feels uniform. Use ease-in-out for elements that expand and contract, like a pulsing effect.

transform Property Values

The transform property is the workhorse of CSS animations. Common functions:

FunctionExampleEffect
translateX(n)translateX(50px)Move horizontally
translateY(n)translateY(-20px)Move vertically
translate(x, y)translate(10px, 20px)Move both axes
scale(n)scale(1.5)Uniform scale
scaleX(n) / scaleY(n)scaleX(0.5)Scale one axis
rotate(deg)rotate(360deg)Rotate
skewX(deg)skewX(15deg)Skew horizontally

Combine multiple transforms in one value: transform: translateY(-40px) scale(1.1) rotate(5deg);

animation-fill-mode

fill-mode determines what styles apply before the animation starts and after it ends:

animation-direction

Performance Tips

Animate only compositor-friendly properties for smooth 60 fps animation:

Properties that trigger layout or paint (avoid in loops):

For animations that require non-compositor properties, consider using the will-change hint:

.animated-element {
  will-change: transform, opacity;
}

Frequently Asked Questions

What is the difference between CSS animations and CSS transitions? CSS transitions animate a property from its current value to a new value when that value changes (usually triggered by :hover or a class toggle). CSS animations use @keyframes to define a sequence with multiple steps and can play automatically, loop, and alternate direction without any trigger.

Can I animate multiple properties at the same time? Yes. Within each keyframe stop you can set as many CSS properties as needed. The browser interpolates all of them simultaneously.

How do I pause and resume a CSS animation with JavaScript? Set element.style.animationPlayState = 'paused' to pause and 'running' to resume.

Why does my animation jump at the end? This usually means the 0% and 100% keyframes are not aligned. If you want a seamless loop, ensure those keyframes have the same property values. Also try animation-direction: alternate for automatic smooth reversal.

How do I chain multiple animations? Use the animation property with a comma-separated list:

.element {
  animation: fade-in 0.3s ease forwards,
             slide-up 0.3s ease 0.1s forwards;
}

What does animation-fill-mode: forwards do? It makes the element hold the last keyframe’s styles after the animation finishes. Without it, the element reverts to its pre-animation state when the animation ends.

Related Tools

More CSS Tools