Agent Skillsnexu-io/motion-anything › gsap-performance

gsap-performance

GitHub

GSAP性能优化技能,指导通过优先使用transform和opacity、避免布局抖动、合理使用will-change及批量读写来确保60fps流畅动画。涵盖stagger、quickTo及ScrollTrigger等场景的最佳实践。

skills/gsap/gsap-performance/SKILL.md nexu-io/motion-anything

Trigger Scenarios

优化 GSAP 动画性能 减少动画卡顿或 jank 询问关于 FPS 或 60fps 流畅度问题 需要提升动画渲染效率

Install

npx skills add nexu-io/motion-anything --skill gsap-performance -g -y
More Options

Non-standard path

npx skills add https://github.com/nexu-io/motion-anything/tree/main/skills/gsap/gsap-performance -g -y

Use without installing

npx skills use nexu-io/motion-anything@gsap-performance

指定 Agent (Claude Code)

npx skills add nexu-io/motion-anything --skill gsap-performance -a claude-code -g -y

安装 repo 全部 skill

npx skills add nexu-io/motion-anything --all -g -y

预览 repo 内 skill

npx skills add nexu-io/motion-anything --list

SKILL.md

Frontmatter
{
    "name": "gsap-performance",
    "license": "MIT",
    "description": "Official GSAP skill for performance — prefer transforms, avoid layout thrashing, will-change, batching. Use when optimizing GSAP animations, reducing jank, or when the user asks about animation performance, FPS, or smooth 60fps."
}

GSAP Performance

When to Use This Skill

Apply when optimizing GSAP animations for smooth 60fps, reducing layout/paint cost, or when the user asks about performance, jank, or best practices for fast animations.

Related skills: Build animations with gsap-core (transforms, autoAlpha) and gsap-timeline; for ScrollTrigger performance see gsap-scrolltrigger.

Prefer Transform and Opacity

Animating transform (x, y, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY) and opacity keeps work on the compositor and avoids layout and most paint. Avoid animating layout-heavy properties when a transform can achieve the same effect.

  • ✅ Prefer: x, y, scale, rotation, opacity.
  • ❌ Avoid when possible: width, height, top, left, margin, padding (they trigger layout and can cause jank).

GSAP’s x and y use transforms (translate) by default; use them instead of left/top for movement.

will-change

Use will-change in CSS on elements that will animate. It hints the browser to promote the layer.

will-change: transform;

Batch Reads and Writes

GSAP batches updates internally. When mixing GSAP with direct DOM reads/writes or layout-dependent code, avoid interleaving reads and writes in a way that causes repeated layout thrashing. Prefer doing all reads first, then all writes (or let GSAP handle the writes in one go).

Many Elements (Stagger, Lists)

  • Use stagger instead of many separate tweens with manual delays when the animation is the same; it’s more efficient.
  • For long lists, consider virtualization or animating only visible items; avoid creating hundreds of simultaneous tweens if it causes jank.
  • Reuse timelines where possible; avoid creating new timelines every frame.

Frequently updated properties (e.g. mouse followers)

Prefer gsap.quickTo() for properties that are updated often (e.g. mouse-follower x/y). It reuses a single tween instead of creating new tweens on each update.

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
    yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });

document.querySelector("#container").addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

ScrollTrigger and Performance

  • pin: true promotes the pinned element; pin only what’s needed.
  • scrub with a small value (e.g. scrub: 1) can reduce work during scroll; test on low-end devices.
  • Call ScrollTrigger.refresh() only when layout actually changes (e.g. after content load), not on every resize; debounce when possible.

Reduce Simultaneous Work

  • Pause or kill off-screen or inactive animations when they’re not visible (e.g. when the user navigates away).
  • Avoid animating huge numbers of properties on many elements at once; simplify or sequence if needed.

Best practices

  • ✅ Animate transform and opacity; use will-change in CSS only on elements that animate.
  • ✅ Use stagger instead of many separate tweens with manual delays when the animation is the same.
  • ✅ Use gsap.quickTo() for frequently updated properties (e.g. mouse followers).
  • ✅ Clean up or kill off-screen animations; call ScrollTrigger.refresh() when layout changes, debounced when possible.

Do Not

  • ❌ Animate width/ height/ top/ left for movement when x/ y/ scale can achieve the same look.
  • ❌ Set will-change or force3D on every element “just in case”; use for elements that are actually animating.
  • ❌ Create hundreds of overlapping tweens or ScrollTriggers without testing on low-end devices.
  • ❌ Ignore cleanup; stray tweens and ScrollTriggers keep running and can hurt performance and correctness.

Version History

  • b016900 Current 2026-07-11 17:11

Same Skill Collection

recipes/animxyz/xyz-fade-big/SKILL.md
recipes/animxyz/xyz-fade-down/SKILL.md
recipes/animxyz/xyz-fade-left/SKILL.md
recipes/animxyz/xyz-fade-right/SKILL.md
recipes/animxyz/xyz-fade-small/SKILL.md
recipes/animxyz/xyz-fade-up/SKILL.md
recipes/animxyz/xyz-flip-left/SKILL.md
recipes/animxyz/xyz-flip-up/SKILL.md
recipes/animxyz/xyz-rise-big/SKILL.md
recipes/animxyz/xyz-rotate/SKILL.md
recipes/app/bottom-sheet/SKILL.md
recipes/app/button-press/SKILL.md
recipes/app/checkbox-pop/SKILL.md
recipes/app/ripple/SKILL.md
recipes/app/tab-bar-slide/SKILL.md
recipes/app/toast-pop/SKILL.md
recipes/css/anim-backindown/SKILL.md
recipes/css/anim-backinleft/SKILL.md
recipes/css/anim-backinright/SKILL.md
recipes/css/anim-backinup/SKILL.md
recipes/css/anim-backoutdown/SKILL.md
recipes/css/anim-backoutleft/SKILL.md
recipes/css/anim-backoutright/SKILL.md
recipes/css/anim-backoutup/SKILL.md
recipes/css/anim-bounce/SKILL.md
recipes/css/anim-bouncein/SKILL.md
recipes/css/anim-bounceindown/SKILL.md
recipes/css/anim-bounceinleft/SKILL.md
recipes/css/anim-bounceinright/SKILL.md
recipes/css/anim-bounceinup/SKILL.md
recipes/css/anim-bounceout/SKILL.md
recipes/css/anim-bounceoutdown/SKILL.md
recipes/css/anim-bounceoutleft/SKILL.md
recipes/css/anim-bounceoutright/SKILL.md
recipes/css/anim-bounceoutup/SKILL.md
recipes/css/anim-fadein/SKILL.md
recipes/css/anim-fadeinbottomleft/SKILL.md
recipes/css/anim-fadeinbottomright/SKILL.md
recipes/css/anim-fadeindown/SKILL.md
recipes/css/anim-fadeindownbig/SKILL.md
recipes/css/anim-fadeinleft/SKILL.md
recipes/css/anim-fadeinleftbig/SKILL.md
recipes/css/anim-fadeinright/SKILL.md
recipes/css/anim-fadeinrightbig/SKILL.md
recipes/css/anim-fadeintopleft/SKILL.md
recipes/css/anim-fadeintopright/SKILL.md
recipes/css/anim-fadeinup/SKILL.md
recipes/css/anim-fadeinupbig/SKILL.md
recipes/css/anim-fadeout/SKILL.md
recipes/css/anim-fadeoutbottomleft/SKILL.md
recipes/css/anim-fadeoutbottomright/SKILL.md
recipes/css/anim-fadeoutdown/SKILL.md
recipes/css/anim-fadeoutdownbig/SKILL.md
recipes/css/anim-fadeoutleft/SKILL.md
recipes/css/anim-fadeoutleftbig/SKILL.md
recipes/css/anim-fadeoutright/SKILL.md
recipes/css/anim-fadeoutrightbig/SKILL.md
recipes/css/anim-fadeouttopleft/SKILL.md
recipes/css/anim-fadeouttopright/SKILL.md
recipes/css/anim-fadeoutup/SKILL.md
recipes/css/anim-fadeoutupbig/SKILL.md
recipes/css/anim-flash/SKILL.md
recipes/css/anim-flipinx/SKILL.md
recipes/css/anim-flipiny/SKILL.md
recipes/css/anim-headshake/SKILL.md
recipes/css/anim-heartbeat/SKILL.md
recipes/css/anim-hinge/SKILL.md
recipes/css/anim-jackinthebox/SKILL.md
recipes/css/anim-jello/SKILL.md
recipes/css/anim-lightspeedinleft/SKILL.md
recipes/css/anim-lightspeedinright/SKILL.md
recipes/css/anim-pulse/SKILL.md
recipes/css/anim-rollin/SKILL.md
recipes/css/anim-rollout/SKILL.md
recipes/css/anim-rotatein/SKILL.md
recipes/css/anim-rotateindownleft/SKILL.md
recipes/css/anim-rotateindownright/SKILL.md
recipes/css/anim-rotateinupleft/SKILL.md
recipes/css/anim-rotateinupright/SKILL.md
recipes/css/anim-rotateout/SKILL.md
recipes/css/anim-rotateoutdownleft/SKILL.md
recipes/css/anim-rotateoutdownright/SKILL.md
recipes/css/anim-rotateoutupleft/SKILL.md
recipes/css/anim-rotateoutupright/SKILL.md
recipes/css/anim-rubberband/SKILL.md
recipes/css/anim-shake/SKILL.md
recipes/css/anim-shakex/SKILL.md
recipes/css/anim-shakey/SKILL.md
recipes/css/anim-slideindown/SKILL.md
recipes/css/anim-slideinleft/SKILL.md
recipes/css/anim-slideinright/SKILL.md
recipes/css/anim-slideinup/SKILL.md
recipes/css/anim-slideoutdown/SKILL.md
recipes/css/anim-slideoutleft/SKILL.md
recipes/css/anim-slideoutright/SKILL.md
recipes/css/anim-slideoutup/SKILL.md
recipes/css/anim-swing/SKILL.md
recipes/css/anim-tada/SKILL.md
recipes/css/anim-wobble/SKILL.md
recipes/css/anim-zoomin/SKILL.md
recipes/css/anim-zoomindown/SKILL.md
recipes/css/anim-zoominleft/SKILL.md
recipes/css/anim-zoominright/SKILL.md
recipes/css/anim-zoominup/SKILL.md
recipes/css/anim-zoomout/SKILL.md
recipes/css/anim-zoomoutdown/SKILL.md
recipes/css/anim-zoomoutleft/SKILL.md
recipes/css/anim-zoomoutright/SKILL.md
recipes/css/anim-zoomoutup/SKILL.md
recipes/lottie/lottie-fab/SKILL.md
recipes/lottie/lottie-favorite/SKILL.md
recipes/lottie/lottie-pagination/SKILL.md
recipes/lottie/lottie-tab/SKILL.md
recipes/slides/fx-chain-react/SKILL.md
recipes/slides/fx-confetti/SKILL.md
recipes/slides/fx-constellation/SKILL.md
recipes/slides/fx-counter-explosion/SKILL.md
recipes/slides/fx-data-stream/SKILL.md
recipes/slides/fx-firework/SKILL.md
recipes/slides/fx-galaxy-swirl/SKILL.md
recipes/slides/fx-gradient-blob/SKILL.md
recipes/slides/fx-knowledge-graph/SKILL.md
recipes/slides/fx-letter-explode/SKILL.md
recipes/slides/fx-magnetic-field/SKILL.md
recipes/slides/fx-matrix-rain/SKILL.md
recipes/slides/fx-neural-net/SKILL.md
recipes/slides/fx-orbit-ring/SKILL.md
recipes/slides/fx-particle-burst/SKILL.md
recipes/slides/fx-shockwave/SKILL.md
recipes/slides/fx-sparkle-trail/SKILL.md
recipes/slides/fx-starfield/SKILL.md
recipes/slides/fx-typewriter-multi/SKILL.md
recipes/slides/fx-word-cascade/SKILL.md
recipes/web/attention-pulse/SKILL.md
recipes/web/aurora/SKILL.md
recipes/web/balatro/SKILL.md
recipes/web/border-beam/SKILL.md
recipes/web/card-lift-hover/SKILL.md
recipes/web/count-up/SKILL.md
recipes/web/dark-veil/SKILL.md
recipes/web/decrypted-text/SKILL.md
recipes/web/dither/SKILL.md
recipes/web/dot-field/SKILL.md
recipes/web/dot-grid/SKILL.md
recipes/web/elastic-slider/SKILL.md
recipes/web/fade-in-up/SKILL.md
recipes/web/faulty-terminal/SKILL.md
recipes/web/ferrofluid/SKILL.md
recipes/web/galaxy/SKILL.md
recipes/web/glare-hover/SKILL.md
recipes/web/glitch-text/SKILL.md
recipes/web/gradient-blinds/SKILL.md
recipes/web/gradient-text/SKILL.md
recipes/web/grainient/SKILL.md
recipes/web/iridescence/SKILL.md
recipes/web/kinetic-headline/SKILL.md
recipes/web/light-rays/SKILL.md
recipes/web/lightfall/SKILL.md
recipes/web/lightning/SKILL.md
recipes/web/like-burst/SKILL.md
recipes/web/line-waves/SKILL.md
recipes/web/liquid-chrome/SKILL.md
recipes/web/loading-shimmer/SKILL.md
recipes/web/magnetic-button/SKILL.md
recipes/web/particles/SKILL.md
recipes/web/pixel-blast/SKILL.md
recipes/web/pixel-snow/SKILL.md
recipes/web/pixel-transition/SKILL.md
recipes/web/plasma-wave/SKILL.md
recipes/web/plasma/SKILL.md
recipes/web/prismatic-burst/SKILL.md
recipes/web/ripple-grid/SKILL.md
recipes/web/ripple-press/SKILL.md
recipes/web/scroll-reveal/SKILL.md
recipes/web/shimmer-button/SKILL.md
recipes/web/shine-border/SKILL.md
recipes/web/shiny-text/SKILL.md
recipes/web/shuffle-text/SKILL.md
recipes/web/side-rays/SKILL.md
recipes/web/soft-aurora/SKILL.md
recipes/web/splash-cursor/SKILL.md
recipes/web/spotlight-card/SKILL.md
recipes/web/stagger-list/SKILL.md
recipes/web/star-border/SKILL.md
recipes/web/stepper/SKILL.md
recipes/web/strands/SKILL.md
recipes/web/text-scramble/SKILL.md
recipes/web/threads/SKILL.md
recipes/web/tilt-3d/SKILL.md
recipes/web/toggle-spring/SKILL.md
skills/gsap/gsap-frameworks/SKILL.md
skills/gsap/gsap-plugins/SKILL.md
skills/gsap/gsap-react/SKILL.md
skills/gsap/gsap-scrolltrigger/SKILL.md
skills/gsap/gsap-timeline/SKILL.md
skills/gsap/gsap-utils/SKILL.md
skills/web-clone/SKILL.md
skills/gsap/gsap-core/SKILL.md
skills/web-shader-extractor/SKILL.md
skills/web-to-design-md/SKILL.md
recipes/web/blob-cursor/SKILL.md
recipes/web/blur-text/SKILL.md
recipes/web/bounce-cards/SKILL.md
recipes/web/circular-text/SKILL.md
recipes/web/click-spark/SKILL.md
recipes/web/counter/SKILL.md
recipes/web/crosshair/SKILL.md
recipes/web/dock/SKILL.md
recipes/web/electric-border/SKILL.md
recipes/web/fade-content/SKILL.md
recipes/web/falling-text/SKILL.md
recipes/web/glass-icons/SKILL.md
recipes/web/gooey-nav/SKILL.md
recipes/web/gradual-blur/SKILL.md
recipes/web/image-trail/SKILL.md
recipes/web/magnet-lines/SKILL.md
recipes/web/noise/SKILL.md
recipes/web/orb/SKILL.md
recipes/web/pixel-card/SKILL.md
recipes/web/prism/SKILL.md
recipes/web/radar/SKILL.md
recipes/web/rotating-text/SKILL.md
recipes/web/scroll-float/SKILL.md
recipes/web/silk/SKILL.md
recipes/web/target-cursor/SKILL.md
recipes/web/true-focus/SKILL.md
recipes/web/waves/SKILL.md
skills/motion-anything/SKILL.md

Metadata

Files
0
Version
b016900
Hash
cb5408d6
Indexed
2026-07-11 17:11

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-14 12:02
浙ICP备14020137号-1 $mapa de visitantes$