Design · Skill

Add scroll animations

add-scroll-animations

Adds a few scroll-linked motions - fade-in on enter, a pinned panel, or a progress cue - with GSAP ScrollTrigger or Motion, and respects reduced motion. Use when the user wants a scroll animation, a fade-in as they scroll, parallax, or a pinned section.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/raw' -o ~/'.claude/skills/add-scroll-animations/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/files/LICENSE.txt' -o ~/'.claude/skills/add-scroll-animations/LICENSE.txt'

Cursor (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/raw' -o '.cursor/skills/add-scroll-animations/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/files/LICENSE.txt' -o '.cursor/skills/add-scroll-animations/LICENSE.txt'

Codex and other Agent Skills tools (this project)

curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/raw' -o '.agents/skills/add-scroll-animations/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/add-scroll-animations/files/LICENSE.txt' -o '.agents/skills/add-scroll-animations/LICENSE.txt'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

Motion should explain the page, not decorate every block. Start with the smallest effect that still reads. Skip it when the visitor asks for less motion.

When to use

  • Sections should fade or slide in as they enter the viewport.
  • One panel should stay pinned while later content moves past it.
  • A bar should track how far down the page the reader is.

When not to use

  • The task is the headline, the call to action, or the section order. That is a page-structure task.
  • The layout overflows on a phone. Settle the layout, then add motion.
  • The user wants a theme, colours, or type scale.

Steps

  1. Pick one effect. Fade-on-enter, pin, or progress. Do not stack all three on the first pass.
  2. If the page is mostly static, a CSS animation plus an intersection check is enough. Reach for a library only when you need a pin or a scrubbed timeline.
  3. On a React page, use Motion (motion, or the older framer-motion package). whileInView with viewport={{ once: true }} covers a fade-in. useScroll plus useTransform covers a value tied to scroll position.
  4. For a pin, a horizontal strip, or a scrubbed timeline, use GSAP. Install gsap, import ScrollTrigger, and call gsap.registerPlugin(ScrollTrigger) once, first.
  5. Honour prefers-reduced-motion: reduce. Skip the tween and show the final state. In GSAP, ScrollTrigger.matchMedia can drop the motion. In Motion, skip the variant.
  6. On a client page, create the trigger after the node exists and kill it on unmount so a route change does not leave a stale pin.
  7. Scroll the page on a phone and on a wide window. The effect should not cause sideways overflow or a jump when it starts.
<motion.section
  initial={{ opacity: 0, y: 12 }}
  whileInView={{ opacity: 1, y: 0 }}
  viewport={{ once: true, amount: 0.3 }}
  transition={{ duration: 0.4 }}
>
  {children}
</motion.section>

Gotchas

  • Do not animate a control that reveals a password, a token, or a private balance. Those should be visible without motion.
  • once: true is kinder than replaying the fade every time the block re-enters.
  • A pinned section that is taller than the screen traps the reader. Keep the pin short.
  • Register ScrollTrigger once. Registering inside a render loop leaks triggers.

Portability

GSAP fits vanilla JS, Vue, and React. Motion fits React. If you use neither, a CSS @keyframes fade plus IntersectionObserver covers the enter effect. The reduced-motion check stays the same.

Done when

  • One scroll effect runs, and it is absent when reduced motion is set.
  • Triggers are cleaned up on unmount.
  • The page does not overflow sideways because of the motion.

Example prompt

"Fade each feature block in once as it enters the viewport, using Motion, and skip the animation when the user prefers reduced motion."

---

Adapted from "gsap-framer-scroll-animation" by Utkarsh Patrikar in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.

Bundled files

Licence

Adapted from Utkarsh Patrikar (github/awesome-copilot, gsap-framer-scroll-animation) (Copyright GitHub, Inc.), MIT License. Adapted by TheSkillVault: rewritten as a short choice (CSS, Motion whileInView, or GSAP pin) with one original snippet; dropped the recipe catalogue and Copilot prompt list; added reduced-motion, gotchas and done-when.

Licence: MIT License. Attribution when you reuse it: Based on work by Utkarsh Patrikar (github/awesome-copilot, gsap-framer-scroll-animation) (Copyright GitHub, Inc., MIT License), https://github.com/github/awesome-copilot/tree/5269f7ea2d6c3a9bfda5ed878b6726cf509121fd/skills/gsap-framer-scroll-animation; adapted by TheSkillVault, https://theskillvault.ai