gsap-performance

Optimizes GSAP animations for smooth 60fps rendering using transforms and batching.

1|Updated Aug 20, 2023
One-click install
npx skills add https://github.com/imanlangaran/mini-projects --skill gsap-performance-imanlangaran
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gsap-performance
Source: https://github.com/imanlangaran/mini-projects/tree/main/building-sell/.claude/skills/gsap-performance
Command: npx skills add https://github.com/imanlangaran/mini-projects --skill gsap-performance-imanlangaran

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? GSAP animations can cause jank, dropped frames, and layout thrashing when developers animate layout-heavy properties or create excessive tweens. This Skill provides concrete guidance to keep animations on the compositor thread and maintain smooth 60fps rendering. ## Core Features & Use Cases - Transform-First Animation: Guides you to animate x, y, scale, rotation, and opacity instead of layout-triggering properties like width, height, top, and left. - Efficient Update Patterns: Recommends gsap.quickTo() for frequently updated properties such as mouse followers, and stagger instead of many separate tweens. - ScrollTrigger Optimization: Covers pin promotion, scrub tuning, and debounced ScrollTrigger.refresh() calls to reduce scroll-related work. - Use Case: When a user reports a laggy scroll-driven animation or a janky mouse-follower effect, apply these rules to replace layout-heavy tweens with compositor-friendly transforms and reusable quickTo instances. ## Quick Start Review my GSAP animation code and optimize it for smooth 60fps performance using transforms and quickTo.

Frequently Asked Questions about gsap-performance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make GSAP animations run at 60fps?

Animate transform properties (x, y, scale, rotation) and opacity, which stay on the compositor and avoid layout and paint. Avoid animating width, height, top, left, margin, or padding, since these trigger layout and cause jank.

How to optimize GSAP mouse follower animations?

Use gsap.quickTo() for frequently updated properties like mouse-follower x and y positions. It reuses a single tween instead of creating a new tween on every mousemove event, reducing overhead significantly.

Should I use will-change on all animated elements?

No, apply will-change: transform only to elements that will actually animate. Setting it on every element wastes memory and compositor resources without benefit, so use it selectively as a layer promotion hint.

Why does my GSAP ScrollTrigger animation lag on scroll?

Lag often comes from excessive pinning, calling ScrollTrigger.refresh() on every resize, or too many simultaneous triggers. Pin only what is needed, use a small scrub value, and debounce refresh calls to fire only when layout actually changes.

When should I use stagger instead of multiple tweens in GSAP?

Use stagger whenever many elements share the same animation, since it is more efficient than creating separate tweens with manual delays. For long lists, also consider virtualization or animating only visible items to avoid hundreds of simultaneous tweens.