
Gsap Scrolltrigger
Implement scroll-driven animations—pinning, scrub, snap, and parallax—with GSAP ScrollTrigger in a marketing or product UI.
Overview
GSAP ScrollTrigger is an agent skill for the Build phase that implements scroll-driven animations including pinning, scrubbing, snap, and parallax with the GSAP ScrollTrigger plugin.
Install
npx skills add https://github.com/bbeierle12/skill-mcp-claude --skill gsap-scrolltriggerWhat is this skill?
- npm install gsap plus ScrollTrigger registerPlugin bootstrap
- Configurable trigger, start, end, scrub, and toggleActions patterns
- Start/end position cheat sheet (top center, top 80%, center center, bottom top, top top+=100)
- Covers pinning, scrubbing, snap points, and parallax-style scroll experiences
- Quick Start snippet ties animation targets to scrollTrigger object on gsap.to
- Documents start/end position formats including top center, top 80%, and top top+=100
- Quick Start requires gsap.registerPlugin(ScrollTrigger) after npm install gsap
Adoption & trust: 521 installs on skills.sh; 8 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need scroll-linked motion or sticky storytelling sections but CSS-only approaches break down for scrubbed timelines and pin spacing.
Who is it for?
Indie builders shipping polished marketing sites or SaaS dashboards who already use or plan to use GSAP for motion.
Skip if: Backend APIs, native mobile apps without a web view, or teams that forbid client-side animation libraries for bundle-size reasons.
When should I use this skill?
When creating scroll-driven animations, sticky sections, progress indicators, or parallax scrolling experiences with GSAP ScrollTrigger.
What do I get? / Deliverables
You get working ScrollTrigger configurations—triggers, start/end, scrub—and starter patterns for parallax and pinned sections in your frontend bundle.
- ScrollTrigger animation snippets
- Registered plugin setup and trigger configuration
Recommended Skills
Journey fit
How it compares
Frontend animation recipe skill—not an MCP server and not a generic CSS-only scroll utility.
Common Questions / FAQ
Who is gsap-scrolltrigger for?
GSAP ScrollTrigger is for solo frontend builders and designers coding in JavaScript who want agent-guided scroll animations on web UIs.
When should I use gsap-scrolltrigger?
Use it in Build frontend when creating scroll-driven animations, sticky pinned sections, scroll progress indicators, or parallax scrolling experiences.
Is gsap-scrolltrigger safe to install?
It is documentation and code patterns for npm gsap; review the Security Audits panel on this page and pin dependency versions in your own package.json.
SKILL.md
READMESKILL.md - Gsap Scrolltrigger
# GSAP ScrollTrigger Scroll-driven animations and interactions. ## Quick Start ```bash npm install gsap ``` ```javascript import gsap from 'gsap'; import { ScrollTrigger } from 'gsap/ScrollTrigger'; gsap.registerPlugin(ScrollTrigger); gsap.to('.box', { x: 500, scrollTrigger: { trigger: '.box', start: 'top center', end: 'bottom center', scrub: true } }); ``` ## Core Concepts ### Basic ScrollTrigger ```javascript gsap.to('.element', { x: 200, scrollTrigger: { trigger: '.element', // Element that triggers the animation start: 'top center', // When trigger hits viewport center end: 'bottom center', // When trigger leaves viewport center toggleActions: 'play pause resume reset' } }); ``` ### Start/End Positions ```javascript // Format: "trigger-position viewport-position" start: 'top center' // Trigger's top hits viewport center start: 'top 80%' // Trigger's top hits 80% down viewport start: 'center center' // Trigger's center hits viewport center start: 'bottom top' // Trigger's bottom hits viewport top start: 'top top+=100' // Trigger's top hits 100px below viewport top ``` ### Position Reference | Value | Description | |-------|-------------| | `top` | Top edge | | `center` | Center | | `bottom` | Bottom edge | | `80%` | 80% from top | | `+=100` | Plus 100 pixels | | `-=50` | Minus 50 pixels | ## Scrub Animations ### Basic Scrub ```javascript // Animation progress tied to scroll position gsap.to('.progress-bar', { scaleX: 1, scrollTrigger: { trigger: '.content', start: 'top top', end: 'bottom bottom', scrub: true // Directly linked to scroll } }); ``` ### Smooth Scrub ```javascript gsap.to('.element', { x: 500, scrollTrigger: { trigger: '.section', scrub: 1, // 1 second smoothing // scrub: 0.5 // 0.5 second smoothing // scrub: 2 // 2 second smoothing (laggy feel) } }); ``` ### Scrub with Timeline ```javascript const tl = gsap.timeline({ scrollTrigger: { trigger: '.container', start: 'top top', end: '+=3000', // Scroll distance scrub: 1, pin: true } }); tl.to('.step1', { opacity: 1 }) .to('.step2', { opacity: 1 }) .to('.step3', { opacity: 1 }); ``` ## Pinning ### Basic Pin ```javascript ScrollTrigger.create({ trigger: '.panel', start: 'top top', end: '+=500', // Pin for 500px of scroll pin: true }); ``` ### Pin with Animation ```javascript gsap.to('.content', { x: '-200%', ease: 'none', scrollTrigger: { trigger: '.horizontal-section', start: 'top top', end: () => '+=' + document.querySelector('.horizontal-section').offsetWidth, pin: true, scrub: 1 } }); ``` ### Pin Spacing ```javascript ScrollTrigger.create({ trigger: '.section', pin: true, pinSpacing: true, // Default: adds space for pinned duration // pinSpacing: false // No extra space (content overlaps) // pinSpacing: '500px' // Custom spacing }); ``` ## Toggle Actions ### Action Syntax ```javascript // Format: "onEnter onLeave onEnterBack onLeaveBack" toggleActions: 'play pause resume reset' // Common combinations: toggleActions: 'play none none none' // Play once toggleActions: 'play reverse play reverse' // Toggle direction toggleActions: 'restart none none none' // Restart each time toggleActions: 'play complete reverse reset' ``` ### Action Values | Action | Effect | |--------|--------| | `play` | Play forward | | `pause` | Pause | | `resume` | Resume from paused | | `reverse` | Play backward | | `restart` | Restart from beginning | | `reset` | Reset to start (no animation) | | `complete` | Jump to end | | `none` | Do nothing | ## Snap Points ### Basi