New to Claude Skills? Learn how to install them →

mengto on GitHub

GSAP Web Animation

Free

Enhance web interfaces with professional animations using GSAP.

by mengto4.6k stars on mengto/skills
2 views
Updated Aug 9, 2026
Get this skill

Free · Opens the source repo

What GSAP Web Animation does

GSAP (GreenSock Animation Platform) is a powerful JavaScript library designed for creating high-performance animations in web applications. This skill provides developers and designers with the necessary tools to implement complex animations, including timelines, scroll-driven effects, and sophisticated easing functions. It is particularly useful for those who want to add engaging micro-interactions, page transitions, and dynamic storytelling to their websites. The skill emphasizes best practices to ensure smooth motion and optimal performance across various devices.

With GSAP, you can utilize a variety of key concepts such as tweens and timelines, which allow for precise control over animations. The skill includes detailed instructions on using GSAP's core methods like gsap.to(), gsap.from(), and gsap.fromTo(), as well as how to create timelines that sequence animations effectively. Additionally, the ScrollTrigger plugin is covered, enabling developers to create animations that respond to the user's scroll position, making for an interactive experience that can enhance storytelling on the web.

This skill is ideal for web developers and UI/UX designers looking to elevate their projects with professional-grade animations. It serves as a comprehensive guide to not only implement animations but also to debug common issues that arise during development. By following the outlined patterns and practices, users can avoid common pitfalls that lead to janky animations and improve the overall user experience.

Whether you are building a static site or a single-page application, this skill equips you with the knowledge to implement animations that are both visually appealing and performance-friendly. It is a valuable resource for anyone aiming to create modern web applications that stand out through engaging motion design.

When to use it

Use this skill when you need to create high-quality UI animations, such as micro-interactions or page transitions, especially in projects requiring complex timelines or scroll-driven animations.

When not to use it

This skill may not be suitable for simple CSS transitions or for projects that do not require advanced animation techniques.

What you can build with it

Creating Micro-Interactions

Implement subtle animations for buttons and UI elements to enhance user experience.

Building Scroll-Driven Stories

Use ScrollTrigger to create engaging narratives that unfold as users scroll through the page.

Designing Page Transitions

Utilize timelines to create smooth transitions between different sections or pages of your web application.

How to install GSAP Web Animation

View source

1. Install with the skills CLI

npx skills add mengto/skills/gsap --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mengto

GSAP (GreenSock) — Web Animation Skill

When to use

  • High-quality UI/motion design: entrances, micro-interactions, page transitions
  • Timeline-based sequences (vs. scattered CSS transitions)
  • Scroll-driven storytelling (with ScrollTrigger)
  • Complex easing, staggering, orchestration across many elements

Key concepts & APIs

  • Tweens:
    • gsap.to(targets, vars)
    • gsap.from(targets, vars)
    • gsap.fromTo(targets, fromVars, toVars)
  • Timelines:
    • const tl = gsap.timeline({ defaults, repeat, yoyo, paused })
    • Chain: tl.to(...).from(...).addLabel('x').add(() => ...)
    • Position parameter: absolute 1.2, relative "+=0.5", overlap "-=0.3", label "intro"
  • Eases: ease: "power2.out", "expo.inOut", "elastic.out(1, 0.3)"
  • Staggers: stagger: 0.05 or { each, from: "start|center|end|random", grid }
  • Performance-friendly properties:
    • Prefer transforms (x, y, scale, rotation) and opacity (autoAlpha)
  • ScrollTrigger (plugin):
    • gsap.registerPlugin(ScrollTrigger)
    • Inline: gsap.to(".box", { scrollTrigger: ".box", x: 500 })
    • Advanced: scrollTrigger: { trigger, start, end, scrub, pin, snap, markers }
    • Standalone: ScrollTrigger.create({ trigger, start, end, onUpdate, onToggle })

Common pitfalls (and fixes)

  • Animating layout properties (top/left/width/height) → jank
    • Use transforms, add will-change: transform, avoid forced reflow.
  • ScrollTrigger “not firing” due to wrong trigger sizing/overflow containers
    • Ensure trigger exists, has height, and check scroll container (nested scrolling needs config).
  • Not cleaning up in SPA/React
    • Use gsap.context() and revert on unmount; kill triggers (ScrollTrigger.getAll().forEach(t => t.kill())) if needed.
  • FOUC / measuring before fonts/images load
    • Initialize after layout is stable; run ScrollTrigger.refresh() after images load.

Quick recipes

1) Hero entrance (stagger)

gsap.from(".hero [data-anim]", {
  y: 24,
  autoAlpha: 0,
  duration: 0.8,
  ease: "power2.out",
  stagger: 0.06,
});

2) Sequenced timeline

const tl = gsap.timeline({ defaults: { ease: "power2.out", duration: 0.6 } });
tl.from(".nav", { y: -20, autoAlpha: 0 })
  .from(".hero-title", { y: 30, autoAlpha: 0 }, "-=0.2")
  .from(".hero-cta", { scale: 0.95, autoAlpha: 0 }, "-=0.2");

3) Scroll-scrub pinned section

gsap.registerPlugin(ScrollTrigger);

gsap.timeline({
  scrollTrigger: {
    trigger: ".story",
    start: "top top",
    end: "+=800",
    scrub: 1,
    pin: true,
  },
}).to(".story .panel", { xPercent: -200 });

What to ask the user (if requirements unclear)

  • Is this a static site or SPA (React/Next/Vue)? Any page transitions?
  • Do we need scroll-driven sections (pin/scrub/snap)?
  • Performance constraints (mobile support, reduced motion)?

Frequently asked questions about GSAP Web Animation

Similar skills