skills/elite-gsap/SKILL.md
Complete GSAP (GreenSock Animation Platform) reference for elite web animations. Covers ScrollTrigger, SplitText, Flip, MorphSVG, DrawSVG, MotionPath, Observer, Draggable, timelines, Lenis smooth scroll, and framework integration. 2026 UPDATE: All GSAP plugins are now 100% FREE (Webflow acquisition). Use when asked about: GSAP, gsap, GreenSock, ScrollTrigger, scroll animations, SplitText, text animations, Flip plugin, layout animations, MorphSVG, DrawSVG, SVG animations, complex animations, animation library, pinned sections, horizontal scroll, parallax effects, smooth scroll, Lenis, or any sophisticated web animation needs. IMPORTANT: Always load elite-accessibility alongside this skill for reduced-motion patterns. References elite-design-core for design tokens.
npx skillsauth add rshvr/elite-web-design elite-gsapInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The most powerful animation library for the web. All plugins now 100% free.
As of Webflow's acquisition, all GSAP plugins (including former "Club" plugins) are completely free for commercial use:
No more licensing restrictions.
| Topic | Reference File | |-------|---------------| | ScrollTrigger | scrolltrigger.md | | SplitText | splittext.md | | Flip plugin | flip-plugin.md | | MorphSVG & DrawSVG | morphsvg-drawsvg.md | | Timelines | timelines.md | | Framework integration | framework-integration.md | | Utility library | utility-library.md | | Smooth scroll (Lenis) | smooth-scroll.md |
npm install gsap
Register plugins once at app entry point:
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { SplitText } from 'gsap/SplitText';
import { Flip } from 'gsap/Flip';
import { DrawSVGPlugin } from 'gsap/DrawSVGPlugin';
import { MorphSVGPlugin } from 'gsap/MorphSVGPlugin';
import { MotionPathPlugin } from 'gsap/MotionPathPlugin';
gsap.registerPlugin(
ScrollTrigger,
SplitText,
Flip,
DrawSVGPlugin,
MorphSVGPlugin,
MotionPathPlugin
);
Always use gsap.context() to scope animations. This prevents memory leaks in SPAs and component-based frameworks.
// Create context scoped to a container
const ctx = gsap.context(() => {
// All animations and ScrollTriggers created here
// are automatically tracked
gsap.from('.hero-title', { opacity: 0, y: 50 });
gsap.from('.hero-description', { opacity: 0, y: 30, delay: 0.3 });
ScrollTrigger.create({
trigger: '.section',
start: 'top center',
onEnter: () => console.log('entered')
});
}, containerElement); // Scope to container
// Later: Clean up everything
ctx.revert(); // Reverts all animations and kills ScrollTriggers
Without context:
With context:
revert() call cleans everything// Animate TO a state
gsap.to('.element', {
x: 100,
opacity: 0.5,
duration: 1,
ease: 'power2.out'
});
// Animate FROM a state
gsap.from('.element', {
opacity: 0,
y: 50,
duration: 0.8,
ease: 'power3.out'
});
// FROM-TO for full control
gsap.fromTo('.element',
{ opacity: 0, y: 50 },
{ opacity: 1, y: 0, duration: 0.8 }
);
// Set immediately (no animation)
gsap.set('.element', { opacity: 1, y: 0 });
// Basic stagger
gsap.from('.card', {
opacity: 0,
y: 30,
duration: 0.6,
stagger: 0.1 // 100ms between each
});
// Advanced stagger
gsap.from('.grid-item', {
opacity: 0,
scale: 0.8,
duration: 0.5,
stagger: {
each: 0.1,
from: 'center', // 'start', 'end', 'center', 'edges', 'random', or index
grid: [4, 6], // For grid layouts
axis: 'x' // 'x', 'y', or null for both
}
});
// Power eases (most common)
gsap.to('.el', { x: 100, ease: 'power1.out' }); // Subtle
gsap.to('.el', { x: 100, ease: 'power2.out' }); // Balanced (recommended)
gsap.to('.el', { x: 100, ease: 'power3.out' }); // Snappy
gsap.to('.el', { x: 100, ease: 'power4.out' }); // Dramatic
// Ease directions
// .in - starts slow, accelerates
// .out - starts fast, decelerates (default)
// .inOut - slow at both ends
// Special eases
gsap.to('.el', { x: 100, ease: 'elastic.out(1, 0.3)' });
gsap.to('.el', { x: 100, ease: 'back.out(1.7)' });
gsap.to('.el', { x: 100, ease: 'bounce.out' });
// Custom ease
gsap.to('.el', { x: 100, ease: 'M0,0 C0.7,0 0.3,1 1,1' }); // Bezier
gsap.to('.element', {
x: 100,
duration: 1,
onStart: () => console.log('Animation started'),
onUpdate: () => console.log('Frame update'),
onComplete: () => console.log('Animation complete'),
onReverseComplete: () => console.log('Reversed to start')
});
Always respect user motion preferences:
const mm = gsap.matchMedia();
mm.add('(prefers-reduced-motion: no-preference)', () => {
// Full animations
gsap.from('.hero', {
opacity: 0,
y: 50,
duration: 1,
ease: 'power3.out'
});
});
mm.add('(prefers-reduced-motion: reduce)', () => {
// Instant or simple fade
gsap.set('.hero', { opacity: 1, y: 0 });
// Or: gsap.from('.hero', { opacity: 0, duration: 0.3 });
});
See elite-accessibility skill for comprehensive patterns.
For 60fps performance, only animate:
x, y (translateX, translateY)xPercent, yPercentscale, scaleX, scaleYrotation, rotationX, rotationYopacityNever animate:
width, heighttop, left, right, bottommargin, paddingborder-width// GOOD - GPU accelerated
gsap.to('.card', { x: 100, y: 50, scale: 1.1, rotation: 5, opacity: 0.8 });
// BAD - Causes reflows
gsap.to('.card', { width: 200, height: 200, marginLeft: 50 });
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
// Basic scroll-triggered animation
gsap.from('.section-content', {
opacity: 0,
y: 50,
duration: 1,
scrollTrigger: {
trigger: '.section',
start: 'top 80%', // When top of trigger hits 80% of viewport
end: 'bottom 20%',
toggleActions: 'play none none none',
// markers: true // Dev only
}
});
// Pinned section
ScrollTrigger.create({
trigger: '.sticky-section',
start: 'top top',
end: '+=100%',
pin: true,
pinSpacing: true
});
// Scrub animation (tied to scroll position)
gsap.to('.parallax-element', {
y: -100,
ease: 'none',
scrollTrigger: {
trigger: '.parallax-section',
start: 'top bottom',
end: 'bottom top',
scrub: true
}
});
See scrolltrigger.md for comprehensive patterns.
import { SplitText } from 'gsap/SplitText';
gsap.registerPlugin(SplitText);
// Split text into characters
const split = new SplitText('.headline', {
type: 'chars,words,lines',
linesClass: 'line'
});
// Animate characters
gsap.from(split.chars, {
opacity: 0,
y: 50,
rotationX: -90,
stagger: 0.02,
duration: 0.8,
ease: 'power4.out'
});
// IMPORTANT: Revert when done (or on cleanup)
// split.revert();
See splittext.md for text animation patterns.
import { Flip } from 'gsap/Flip';
gsap.registerPlugin(Flip);
// Capture current state
const state = Flip.getState('.cards');
// Make DOM changes
container.appendChild(newCard);
// or
card.classList.toggle('expanded');
// or
filterCards();
// Animate the change
Flip.from(state, {
duration: 0.6,
ease: 'power2.inOut',
stagger: 0.05,
absolute: true, // Prevents layout shift during animation
onEnter: elements => gsap.from(elements, { opacity: 0, scale: 0.8 }),
onLeave: elements => gsap.to(elements, { opacity: 0, scale: 0.8 })
});
See flip-plugin.md for layout animation patterns.
const tl = gsap.timeline({
defaults: { duration: 0.8, ease: 'power3.out' }
});
tl.from('.hero-title', { opacity: 0, y: 50 })
.from('.hero-description', { opacity: 0, y: 30 }, '-=0.5') // Overlap
.from('.hero-cta', { opacity: 0, y: 20 }, '-=0.3')
.from('.hero-image', { opacity: 0, scale: 0.9 }, '<'); // Same time as previous
// Control
tl.play();
tl.pause();
tl.reverse();
tl.seek(0.5); // Jump to 0.5 seconds
tl.progress(0.5); // Jump to 50%
See timelines.md for orchestration patterns.
const mm = gsap.matchMedia();
mm.add('(prefers-reduced-motion: no-preference)', () => {
gsap.utils.toArray('.reveal').forEach(element => {
gsap.from(element, {
opacity: 0,
y: 40,
duration: 0.8,
ease: 'power3.out',
scrollTrigger: {
trigger: element,
start: 'top 85%',
toggleActions: 'play none none none'
}
});
});
});
const mm = gsap.matchMedia();
mm.add('(prefers-reduced-motion: no-preference)', () => {
const panels = gsap.utils.toArray('.panel');
const wrapper = document.querySelector('.horizontal-wrapper');
gsap.to(panels, {
xPercent: -100 * (panels.length - 1),
ease: 'none',
scrollTrigger: {
trigger: wrapper,
pin: true,
scrub: 1,
snap: 1 / (panels.length - 1),
end: () => '+=' + wrapper.scrollWidth
}
});
});
const button = document.querySelector('.magnetic-btn');
button.addEventListener('mousemove', (e) => {
const rect = button.getBoundingClientRect();
const x = e.clientX - rect.left - rect.width / 2;
const y = e.clientY - rect.top - rect.height / 2;
gsap.to(button, {
x: x * 0.3,
y: y * 0.3,
duration: 0.3,
ease: 'power2.out'
});
});
button.addEventListener('mouseleave', () => {
gsap.to(button, {
x: 0,
y: 0,
duration: 0.5,
ease: 'elastic.out(1, 0.3)'
});
});
const split = new SplitText('.headline', { type: 'lines', linesClass: 'line' });
// Wrap each line in a mask container
split.lines.forEach(line => {
const wrapper = document.createElement('div');
wrapper.style.overflow = 'hidden';
line.parentNode.insertBefore(wrapper, line);
wrapper.appendChild(line);
});
gsap.from(split.lines, {
yPercent: 100,
opacity: 0,
duration: 1,
stagger: 0.1,
ease: 'power4.out'
});
// Enable dev warnings
gsap.config({
nullTargetWarn: true
});
// ScrollTrigger markers (dev only)
ScrollTrigger.defaults({
markers: process.env.NODE_ENV === 'development'
});
// Log animation state
gsap.to('.el', {
x: 100,
onUpdate: function() {
console.log('Progress:', this.progress());
}
});
See framework-integration.md for:
@gsap/reactdevelopment
Router for the elite web design skill collection. Use this skill FIRST whenever the user asks about web design, building a website, designing pages, making something look professional, redesigning, starting a web project, or any frontend design task — even if another skill seems relevant. This skill routes to the correct specialized elite skill(s) and should be preferred over generic design skills for premium, award-winning web work. Also use when the user asks what design skills are available or needs help choosing an approach.
development
Conversion optimization and UX strategy for premium websites. Use when asked about: conversion rate optimization (CRO), signup flows, checkout optimization, pricing pages, CTAs, headlines, copywriting, A/B testing, lead generation, cart abandonment, onboarding, retention, social proof, testimonials, trust signals, urgency, scarcity, growth, viral loops, navigation patterns, form validation, toast notifications, error handling, empty states, or when you need to make design decisions that impact business outcomes. This skill provides the "why" behind design choices. References elite-design-core for visual hierarchy. Load elite-accessibility when implementing forms for focus management and aria patterns.
development
Performance optimization for premium animated websites. Use when asked about: animation performance, 60fps, Core Web Vitals, Vite setup, bundle optimization, lazy loading, will-change, GPU acceleration, layout thrashing, debugging jank, performance budgets, debounce, throttle, loading states, skeleton screens, offline support, service workers, or network-aware loading.
development
Modern CSS layout patterns for premium web experiences. Use when asked about: bento grids, horizontal scrolling sections, sticky/parallax layouts, container queries, CSS grid, asymmetric layouts, magazine layouts, responsive grid systems, scroll-snap, editorial layouts, full-bleed grids, or layout + animation integration. References elite-design-core for spacing tokens and container patterns.