How do I build a CSS animation without memorizing @keyframes?
@keyframes is the declarative way to animate in CSS. You define a handful of keyframes (0%, 50%, 100% or more), give each one a set of CSS values (transform, opacity, color), and the browser interpolates smoothly between them. The result is buttery 60fps motion with no JavaScript.
Here you get a visual editor. Click a preset (fade-in, slide, bounce, shake, pulse, spin) or add your own keyframes. Each frame has its own X/Y translate, scale, rotation, opacity and color. Below is a live preview that updates as you change parameters.
The side panel sets globals: duration, easing, iteration count, direction (normal / alternate), fill-mode. Hit "Copy" and you get the full CSS: an `@keyframes` block plus a class with `animation: ...`.
How to use
- Click a preset (fade-in, slide, bounce, pulse, spin) from the gallery below. Each gives you 2-5 ready keyframes.
- On the right you see the keyframe list (0% / 50% / 100%, etc.). Click a frame to edit its properties.
- Sliders: translate X/Y, scale (1 = original, 0.5 = small, 2 = big), rotate in degrees, opacity 0-1, background color.
- Duration (100-5000ms), easing (linear, ease, cubic-bezier), iterations (1, infinite), direction (alternate = back and forth).
- Copy the CSS, paste it into a stylesheet and add the `.target` class to your element. The animation starts automatically.
When this helps
Micro-interactions are what separates premium UI from cheap. A 200-400ms animation on hover, click or reveal makes a site feel alive:
- Fade-in on scroll. Element appears when it enters the viewport, plus a small upward translate = content that "slides in".
- Pulse on a CTA button. A softly pulsing call-to-action draws the eye without being annoying (`pulse` infinite, alternate).
- Shake on form validation error. Password field shakes 300ms when wrong = clear visual feedback.
- Bounce on toast notifications. A small hop as the toast slides in.
- Spin loader. The classic spinner while you wait for a server response (`spin` infinite linear).
- Slide-in mobile menu. Hamburger menu slides in from the right.
- Hero color shift. Background gradient cycles through colors, gives the premium fintech feel.
For custom easing curves see the cubic-bezier generator. For other visual effects see box-shadow and clip-path.