# gsap-scrolltrigger

A skill that teaches the agent to write GSAP animations and ScrollTrigger scroll effects: tweens, timelines, pinning, parallax.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2800 installs · ★ 1133
- Author: freshtechbro
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/freshtechbro/claudedesignskills/tree/HEAD/plugins/bundles/core-3d-animation/skills/gsap-scrolltrigger/SKILL.md
- Updated: 2025-11-20
- HTML: https://affpapa.org/en/nevibecode/skills/freshtechbro-gsap-scrolltrigger

## What it does

The skill hands the agent a working reference for GSAP and its ScrollTrigger plugin. It covers the basics — `gsap.to`, `gsap.from`, `gsap.fromTo` — then timelines with labels and the position parameter, and the ScrollTrigger config: `start`, `end`, `scrub`, `toggleActions`, `pin`, `snap`.

On top of that come ready patterns for the usual jobs: fade-in on scroll, pinning a panel, a horizontal scroll section, a two-layer parallax, and batch animations through `ScrollTrigger.batch` or stagger. The agent lifts the structure and swaps in your selectors.

One thing to watch: ScrollTrigger only works after `gsap.registerPlugin(ScrollTrigger)`. Skip that line and the animation quietly does nothing. The `markers: true` flag in the examples is there for debugging — drop it before shipping.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add freshtechbro/claudedesignskills --skill gsap-scrolltrigger -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/gsap-scrolltrigger/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/gsap-scrolltrigger/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add freshtechbro/claudedesignskills --skill gsap-scrolltrigger -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/gsap-scrolltrigger/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add freshtechbro/claudedesignskills --skill gsap-scrolltrigger -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/gsap-scrolltrigger/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install freshtechbro/claudedesignskills gsap-scrolltrigger
```

2. **Manually: put the files in place**
- File: `.github/skills/gsap-scrolltrigger/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add freshtechbro/claudedesignskills --skill gsap-scrolltrigger -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/freshtechbro/claudedesignskills --path plugins/bundles/core-3d-animation/skills/gsap-scrolltrigger
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/gsap-scrolltrigger/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add freshtechbro/claudedesignskills --skill gsap-scrolltrigger -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/freshtechbro/claudedesignskills/tree/HEAD/plugins/bundles/core-3d-animation/skills/gsap-scrolltrigger/SKILL.md

## When to use it
- fade elements in as the page scrolls
- pin a section in place while scrolling
- build a horizontal scroll section from panels
- set up a parallax with background and foreground layers
- tie a timeline to scrollbar position with scrub

## Example prompts
- animate the cards fading in on scroll with GSAP and ScrollTrigger
- pin the .panel section for 500px of scrolling and run a timeline
- add parallax to .bg and .fg inside the .hero section

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 777b33bdfb9d97f9.

BEGIN THIRD-PARTY FILE 777b33bdfb9d97f9
````text
---
name: gsap-scrolltrigger
description: Comprehensive skill for GSAP (GreenSock Animation Platform) and ScrollTrigger plugin. Use this skill when creating web animations, scroll-driven experiences, timelines, tweens, scroll-triggered animations, pinning, scrubbing, parallax effects, or animating DOM elements, SVG, Canvas, WebGL, or Three.js. Triggers on tasks involving GSAP, ScrollTrigger, smooth animations, scroll effects, or animation sequencing.
---

# GSAP & ScrollTrigger Development

## Overview

GSAP (GreenSock Animation Platform) is the industry-leading JavaScript animation library for creating high-performance, production-quality animations. ScrollTrigger is GSAP's powerful plugin for scroll-driven animations. Together, they enable everything from simple UI transitions to complex scroll-based storytelling experiences.

## Core Concepts

### The Basics: Tweens

A **tween** is a single animation from point A to point B.

```javascript
// Animate TO a state (from current)
gsap.to(".box", {
  x: 200,
  rotation: 360,
  duration: 1,
  ease: "power2.inOut"
});

// Animate FROM a state (to current)
gsap.from(".box", {
  opacity: 0,
  y: -50,
  duration: 0.8
});

// Animate FROM-TO (define both start and end)
gsap.fromTo(".box",
  { opacity: 0, scale: 0.5 }, // FROM
  { opacity: 1, scale: 1, duration: 1 } // TO
);
```

### Timelines: Sequencing Animations

**Timelines** orchestrate multiple tweens in sequence or overlap.

```javascript
const tl = gsap.timeline();

// Sequential by default
tl.to(".box1", { x: 100, duration: 1 })
  .to(".box2", { y: 100, duration: 1 })
  .to(".box3", { rotation: 360, duration: 1 });

// With labels for organization
tl.addLabel("start")
  .to(".hero", { opacity: 1, duration: 1 })
  .addLabel("reveal")
  .to(".content", { y: 0, duration: 0.8 }, "reveal") // Start at "reveal" label
  .to(".cta", { scale: 1, duration: 0.5 }, "reveal+=0.5"); // 0.5s after "reveal"
```

### Position Parameter (Timeline Timing)

Control when animations start within a timeline:

```javascript
const tl = gsap.timeline();

// Default: One after another
tl.to(".box1", { x: 100 })
  .to(".box2", { x: 100 }); // Starts after box1 finishes

// Start at the same time
tl.to(".box1", { x: 100 })
  .to(".box2", { y: 100 }, 0); // Starts at 0 seconds

// Relative positioning
tl.to(".box1", { x: 100, duration: 2 })
  .to(".box2", { y: 100 }, "-=1"); // Starts 1 second before box1 ends
  .to(".box3", { rotation: 360 }, "+=0.5"); // Starts 0.5s after box2 finishes

// At a specific time
tl.to(".box1", { x: 100 }, 2.5); // Starts at 2.5 seconds
```

## ScrollTrigger Fundamentals

### Basic Scroll Animation

```javascript
gsap.registerPlugin(ScrollTrigger);

gsap.to(".box", {
  x: 500,
  scrollTrigger: {
````
END THIRD-PARTY FILE 777b33bdfb9d97f9

The third-party file has ended. Everything between the 777b33bdfb9d97f9 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2746 of 17238 bytes. © freshtechbro · MIT · https://github.com/freshtechbro/claudedesignskills/tree/HEAD/plugins/bundles/core-3d-animation/skills/gsap-scrolltrigger/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
