Add keyframe stops, set a transform and opacity for each, and watch the animation run as you edit. You get both the @keyframes block and the animation shorthand, ready to paste. Presets cover the animations people actually write — fade, slide, pulse, shake, bounce and spin — as starting points rather than finished answers. Stops are sorted before output, because a block that jumps from 100% to 0% to 50% behaves identically and is miserable to maintain, and the animation name is sanitised into a legal identifier, since CSS rejects a name starting with a digit and gives no obvious clue why. Before you ship any of this, wrap it in a prefers-reduced-motion query — for some people animation causes genuine nausea, not mild annoyance.
| Position | Property | Note |
|---|---|---|
| 1 | name | Must be a legal CSS identifier |
| 2 | duration | First time value wins |
| 3 | timing-function | ease, linear, cubic-bezier(...) |
| 4 | delay | Second time value |
| 5 | iteration-count | A number, or infinite |
| 6 | direction | normal, reverse, alternate |
| 7 | fill-mode | forwards keeps the final state |
@keyframes defines what happens — the states at each point through the sequence. animation attaches it to an element and says how long, how many times, and with what easing. You need both, which is why this tool outputs both.
Because duration and delay are both times, and CSS reads the first one it finds as the duration and the second as the delay. Write them the wrong way round and a 0.3s animation with no delay becomes a 0.3s delay with no animation, which looks like nothing happening. Duration is always written first here.
Decides what the element looks like before the animation starts and after it ends. Without it, the element snaps back to its original state the moment the animation finishes — which is why a fade-in often flashes back to invisible. forwards keeps the final state; both keeps the first state during any delay as well.
Most likely it starts with a digit or contains a space. CSS identifiers cannot begin with a number, so 3d-spin is invalid and the rule is discarded with no error you would notice. Names are sanitised automatically here.
A system setting people turn on when movement on screen causes them problems — for those with vestibular disorders, large animations can cause real nausea and dizziness. Wrapping your animation in @media (prefers-reduced-motion: no-preference) means it simply does not run for them. It costs two lines and it is the difference between a site someone can use and one they cannot.
Transform, almost always. Transform and opacity can be handled by the compositor without recalculating layout, so they stay smooth; animating top, left, width or height forces the browser to re-layout every frame and visibly stutters.
Keyframe stops are sorted into ascending order before being written out. Out-of-order stops are perfectly legal CSS and behave identically, but a block that jumps from 100% to 0% to 50% is unreadable, and this is code somebody has to maintain. An empty transform is omitted rather than emitted as a bare declaration, since transform with no value is invalid and would silently kill the whole rule in some parsers. The animation name is sanitised into a legal CSS identifier: spaces become hyphens, runs collapse, and a name starting with a digit is prefixed, because CSS identifiers cannot start with a number and a name like 3d-spin would break the rule without any obvious cause. The shorthand's argument order is load-bearing in one specific place — duration comes before delay, and both are times, so swapping them turns a 0.3s animation with no delay into a 0.3s delay with no visible animation. The generator always writes duration first. Direction and fill-mode are omitted when they hold their default values, keeping the output close to what a person would type. The reduced-motion note is included deliberately rather than as boilerplate: prefers-reduced-motion exists because vestibular disorders make certain animation genuinely nauseating, and a generator that hands people animation code without mentioning it is part of the problem.