Communitygithub.com

yuzhang-ai/web-animation-skill

Design and build interactive web animation that feels crafted, not templated. Use when the user asks for motion on a website or web app - page-load or hero sequences, scroll-driven or scroll-triggered effects, parallax, pinned or horizontal scroll sections, smooth scroll, text reveals and split-text, hover and press micro-interactions, page or route transitions (View Transitions API), modal/popover/dropdown enter-exit, layout and shared-element animation, SVG line drawing and morphing, animated charts, Lottie or Rive playback, canvas or WebGL/Three.js scenes, or "make it feel smoother / more premium / award-winning". Covers GSAP (ScrollTrigger, SplitText, Flip), Motion (formerly Framer Motion and Motion One), Anime.js v4, CSS transitions/@keyframes/@starting-style/scroll-driven animations, View Transitions, Lottie, Rive, D3, Flubber, Konva and Three.js/React Three Fiber. Not for video rendering (use Remotion).

What is web-animation-skill?

web-animation-skill is a Claude Code agent skill that design and build interactive web animation that feels crafted, not templated. Use when the user asks for motion on a website or web app - page-load or hero sequences, scroll-driven or scroll-triggered effects, parallax, pinned or horizontal scroll sections, smooth scroll, text reveals and split-text, hover and press micro-interactions, page or route transitions (View Transitions API), modal/popover/dropdown enter-exit, layout and shared-element animation, SVG line drawing and morphing, animated charts, Lottie or Rive playback, canvas or WebGL/Three.js scenes, or "make it feel smoother / more premium / award-winning". Covers GSAP (ScrollTrigger, SplitText, Flip), Motion (formerly Framer Motion and Motion One), Anime.js v4, CSS transitions/@keyframes/@starting-style/scroll-driven animations, View Transitions, Lottie, Rive, D3, Flubber, Konva and Three.js/React Three Fiber. Not for video rendering (use Remotion).

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/yuzhang-ai/web-animation-skill/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Web animation

Good web motion is a design decision first and a library call second. Follow the workflow below in order; load rule files only when a step needs them.

Workflow

1. Read the project before choosing anything

  • Check package.json. If an animation library is already installed, use it. Don't add a second one for a single effect.
  • Note the framework (React / Next.js App Router / Vue / Svelte / plain HTML) and whether components render on the server ("use client" needed for client-side motion in Next.js).
  • Check for existing motion tokens (durations, easings) in CSS variables or a theme file, and reuse them.

2. Decide what the motion is for

Every animation needs a job. Pick one per element:

JobExampleTypical budget
Feedback — confirm an actionbutton press, toggle, copy-to-clipboard100–200ms
Orientation — show where something came from or wentmodal opens from its trigger, list item reorders, route change200–400ms
Attention — point at one thinga single hero sequence, a new notification400–1200ms, once
Narrative — tell a story tied to scrollpinned product walkthrough, scrubbed timelinetied to scroll distance

If an element has no job, don't animate it. One orchestrated moment beats a fade-up on every section. Read rules/motion-design.md for durations, easing, choreography and the "premium feel" checklist.

3. Pick the lightest tool that does the job

Platform first, then libraries:

NeedReach forRule file
Hover, focus, press, simple loopsCSS transitions / @keyframescss-keyframes.md
Dialog, popover, dropdown enter and exitCSS @starting-style + transition-behavior: allow-discretecss-keyframes.md
Page / route transitions, shared-element morph between statesView Transitions APIview-transitions.md
Simple scroll-linked reveal, progress bar, parallaxCSS animation-timeline: view() / scroll()scroll-animations.md
Pinned sections, scrubbed multi-step timelines, horizontal scrollGSAP + ScrollTriggergsap.md
Split-text / line-mask headline revealsGSAP SplitTextgsap.md
React enter/exit, layout and shared-layout animation, gesturesMotion for React (motion/react)framer-motion.md
Framework-free imperative animation, springsMotion (motion)motion-one.md
SVG line drawing and morphing without GSAPAnime.js v4 (svg.createDrawable, svg.morphTo)animejs.md
Complex path morphing between unrelated shapesFlubber (or GSAP MorphSVG)flubber.md
After Effects animation playbackLottie (dotLottie)lottie.md
Interactive, state-driven illustrated animationRiverive.md
Animated chartsD3 transitionsd3.md
Many interactive 2D shapes (editors, diagrams)Konvakonva.md
3D, particles, shadersThree.js / React Three Fiberthree-js.md

When the choice isn't obvious, read rules/choosing-library.md.

4. Build it with the non-negotiables

These apply to every animation, in every library:

  1. Animate transform and opacity. Avoid animating width, height, top, left, margin; use scale/translate, FLIP (GSAP Flip, Motion layout) or View Transitions for layout changes. See rules/performance.md.
  2. Respect prefers-reduced-motion. Replace movement with an opacity fade or an instant change; never just delete the content's entrance so it stays invisible. Scroll-scrubbed effects should become static.
  3. Never hide content until JS runs. Set the initial hidden state in JS (or behind a .js class), so content is visible if the script fails. With SSR, avoid a flash of visible-then-hidden content by applying initial styles before first paint.
  4. Clean up. Revert or kill animations on unmount (useGSAP, createScope().revert(), gsap.context), and kill ScrollTriggers on route change.
  5. Keep interaction responsive. Interruptible animations for anything user-triggered: a second click must not queue behind the first. Never block input waiting for an animation to finish.
  6. Don't animate focus away. Elements that move must keep a visible :focus-visible state, and animated dialogs must still move focus correctly.

5. Verify in a real browser

Don't report an animation as done from reading the code. Run it and check:

  • It plays, and the end state matches the design (screenshot mid-animation and at rest).
  • No console errors, no layout shift when it starts.
  • Emulate prefers-reduced-motion: reduce and confirm the reduced version works and content is visible.
  • Resize to a mobile width: pinned sections and split text still work (re-split on resize).
  • Scroll-driven effects work when scrolling up as well as down, and after a reload mid-page.
  • Performance panel: no long frames during the animation, no layout/paint spikes from animated properties.

Minimal starting points

// GSAP + ScrollTrigger (npm i gsap)
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);

gsap.from(".card", {
  y: 40, opacity: 0, duration: 0.8, ease: "expo.out", stagger: 0.08,
  scrollTrigger: { trigger: ".cards", start: "top 80%" },
});
// Motion for React (npm i motion)
import { motion, AnimatePresence } from "motion/react";

<AnimatePresence>
  {open && (
    <motion.div
      key="panel"
      initial={{ opacity: 0, y: 8 }}
      animate={{ opacity: 1, y: 0 }}
      exit={{ opacity: 0, y: 8 }}
      transition={{ type: "spring", duration: 0.35, bounce: 0 }}
    />
  )}
</AnimatePresence>
/* Platform-only scroll reveal: Chrome 115+, Safari 26+, Firefox 159+ */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }
  }
}
@keyframes reveal { from { opacity: 0; translate: 0 2rem; } }

Rule files

Working examples of these techniques live in demos/.

Related Skills