anymotion-agent/anymotion/css-animations
Claude Code and agent skill by anymotion-agent/anymotion
- community
Checking that the SKILL.md file is still in the repository.
Practical CSS animation techniques — @keyframes, transitions, custom properties, performance, and when to reach for JavaScript instead. Use when implementing animations with pure CSS or debugging why a CSS animation looks wrong.
Install
npx vskill@latest install anymotion-agent/anymotion/css-animationsSKILL.md
CSS Animations
CSS animations are the fastest path to smooth motion on the web when the motion fits what CSS can express. This covers what CSS does well, what it cannot do, and how to keep it performing.
When CSS is the right answer
- Looping ambient motion — breathing glows, floating elements, infinite
spinners, and modern liquid/mesh animated backgrounds. CSS loops cost nothing; JS loops need requestAnimationFrame.
- State-driven transitions — hover, focus, checked, open. CSS sees the state
change and runs the transition automatically.
- Simple entrance/exit — fade in, slide in, scale up. One
transition
declaration on the element, and every property change animates.
- Performance-first motion — CSS transitions on
transformandopacity
run on the compositor thread, bypassing layout and paint.
When to use JavaScript instead
- Sequenced choreography — if element B must start when A is 70% done, CSS
cannot coordinate that. Use a timeline library or manual RAF loop.
- Dynamic easing — spring physics, momentum scrolling, anything where the
curve depends on user input. CSS easing is fixed at authoring time.
- Seeking / scrubbing — if the user drags a slider and the animation must
jump to frame 47, CSS cannot do it. Animation state is read-only from JS.
- Callbacks — CSS fires
animationendandtransitionend, but if you need
to know when an element is 50% through its travel, JS owns that.
The two mechanisms
`transition` animates a property when it changes. You declare which properties, how long, and what easing, and CSS does the rest whenever those properties update — from a class toggle, a :hover, or JS assigning a value.
`@keyframes` + `animation` runs a named sequence, with as many intermediate steps as you define. It can loop, reverse, and pause, but it starts on load or class add and runs on its own clock. You cannot seek it from JS.
The performance contract
Animate only `transform` and `opacity` for 60fps.
transform: translate()instead ofleftormargintransform: scale()instead ofwidth/heightopacityinstead ofvisibility: hiddenmid-transition
Why: transform and opacity are composited — the browser promotes the element to its own layer and the GPU handles the animation. Changes to layout properties (width, top, margin) force a reflow on every frame.
will-change: transform or a 3D transform like translateZ(0) forces layer promotion. Use it deliberately: every layer costs memory, and too many layers slow the compositor. Promote what actually animates, and remove the hint when the animation is done.
Never animate these without measuring:
filter,backdrop-filter— per-pixel work every framebox-shadowwith large blur — same costclip-pathwith many points — geometry recalculation
Animating the opacity of a pre-blurred or pre-shadowed element is cheap and usually looks identical.
Easing
CSS easing is a cubic Bézier with four control points. The syntax is cubic-bezier(x1, y1, x2, y2), where (x1, y1) and (x2, y2) are the two inner handles. Start and end are always (0,0) and (1,1).
| Name | Curve | Use | |
|---|---|---|---|
ease-out or cubic-bezier(0.16, 1, 0.3, 1) | Fast start, soft landing | Entrances, responses to user action | |
ease-in | Soft start, fast end | Exits only — slow start feels laggy on enter | |
ease-in-out or cubic-bezier(0.65, 0, 0.35, 1) | Soft both ends | Moves and resizes | |
linear | Constant speed | Fades, or when mimicking constant velocity (rare) |
The keywords ease, ease-in, ease-out, ease-in-out are shortcuts; the explicit cubic-bezier form gives you exact control. For springs and overshoot, CSS cannot do it natively — use a JS library or fake it with a multi-step keyframe.
Custom properties (CSS variables) as animation targets
You can animate a custom property and drive other values from it:
This is surprisingly powerful: one animated --progress variable can drive multiple derived values — positions, colours, opacities — with plain calc(). The catch: only browsers from ~2022 onward animate custom properties smoothly; older engines quantize them to integers.
Timing functions are per-property
Each property in a transition list can have its own duration and easing:
The transform takes 400ms with a strong ease-out; opacity finishes in 200ms, nearly linear. This is how you make an element fully visible before it finishes moving — a staple of polished entrances.
animation-fill-mode
Controls what happens before and after the animation runs:
none(default): element returns to its base style after the animationforwards: element holds the final keyframe after the animation endsbackwards: element jumps to the first keyframe before the animation starts
(useful with a delay)
both: combines forwards and backwards
Most real usage: forwards, so the element stays where the animation left it.
Without forwards, the toast would snap back to its starting position the moment the 300ms finishes.
Debugging
Slow it down. Scale all durations by 10× and watch in slow motion — timing errors, easing mistakes, and hidden mid-flight jank become obvious.
DevTools timeline. Most browsers' performance panels show layer compositing and paint. A green bar is composited (cheap); purple is paint (expensive).
Check the computed style mid-transition. getComputedStyle(el).transform during a transform animation returns the interpolated matrix, which tells you where the element actually is when it looks wrong.
Accessibility: prefers-reduced-motion
Never ignore this — vestibular disorders make large motion nauseating. The correct response is to replace movement with fades and cut durations, not to remove all animation (which often breaks comprehension).
That blunt reset is a floor; a considered fade-only alternative is better.
Common mistakes
| Symptom | Cause | |
|---|---|---|
| Transition happens once, then never again | The property isn't actually changing — check with DevTools | |
| Element jumps at the start of the animation | Missing animation-fill-mode: backwards | |
| Animation stutters | Animating layout properties; switch to transform | |
| Transition applies to unwanted properties | transition: all is too broad; list properties explicitly | |
| Easing feels wrong | Using ease-in on an entrance (slow start = feels laggy) | |
| Element disappears mid-transition | Parent has overflow: hidden and the element moves outside; add overflow: visible to the parent or rethink the motion |
When to skip CSS and write JS
If the motion is essential to the experience — a product demo, a data visualization, a game — and CSS cannot express what you need, don't try to hack it into CSS. A clean JS implementation that works beats a CSS trick that almost works.
The lines CSS cannot cross: seeking to an arbitrary frame, coordinating timing across unrelated elements without a shared trigger, dynamic easing (springs, momentum), and n-dimensional motion (a particle system, a physics sim).
For everything else, CSS is faster to write, faster to run, and requires no library.
Modern & Premium Animated Backgrounds in CSS
CSS is the ultimate engine for modern ambient backgrounds (mesh gradients, glowing orbs, 3D perspective grids, SVG grain noise).
Liquid Mesh / Ambient Glow (CSS Radial Gradients + Blur)
Film Grain & SVG Noise Overlay
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/css-animations/SKILL.md
Popularity
- Repository stars
- 70
- Repository forks
- 12
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anymotion-agent/anymotion/css-animations)