本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)7.2k · #13439

gsap

できること

このスキルは、GSAPライブラリでWebアニメーションを書いたりデバッグしたりする作業をAIエージェントに案内します。Webページで、順序立てたシーケンス、スクロールに連動した動き、滑らかな切り替えを作りたい開発者向けです。

使う場面

  • ✓Webページに、洗練された出現やホバーのアニメーションが欲しいとき。
  • ✓多くの要素を、タイミングを決めた順序で動かす必要があるとき。
  • ✓GSAPのアニメーションがかくつく、壊れている、または制御しにくいとき。

スキルのリンク

https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/gsap/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/MengTo/Skills/blob/main/agent-skills/web-design/gsap/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のページの見出しとボタンが、滑らかなフェードとスライドで順番に現れるようにしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、GSAPでトゥイーンとタイムラインを書き、グループにはスタガー、滑らかな動きにはイージングを使います。レイアウトの変更より滑らかに動く、トランスフォームと不透明度を優先し、よくある落とし穴を確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

GSAP (GreenSock) — Web Animation Skill

When to use

  • High-quality UI/motion design: entrances, micro-interactions, page transitions
  • Timeline-based sequences (vs. scattered CSS transitions)
  • Scroll-driven storytelling (with ScrollTrigger)
  • Complex easing, staggering, orchestration across many elements

Key concepts & APIs

  • Tweens:
    • gsap.to(targets, vars)
    • gsap.from(targets, vars)
    • gsap.fromTo(targets, fromVars, toVars)
  • Timelines:
    • const tl = gsap.timeline({ defaults, repeat, yoyo, paused })
    • Chain: tl.to(...).from(...).addLabel('x').add(() => ...)
    • Position parameter: absolute 1.2, relative "+=0.5", overlap "-=0.3", label "intro"
  • Eases: ease: "power2.out", "expo.inOut", "elastic.out(1, 0.3)"
  • Staggers: stagger: 0.05 or { each, from: "start|center|end|random", grid }
  • Performance-friendly properties:
    • Prefer transforms (x, y, scale, rotation) and opacity (autoAlpha)
  • ScrollTrigger (plugin):
    • gsap.registerPlugin(ScrollTrigger)
    • Inline: gsap.to(".box", { scrollTrigger: ".box", x: 500 })
    • Advanced: scrollTrigger: { trigger, start, end, scrub, pin, snap, markers }
    • Standalone: ScrollTrigger.create({ trigger, start, end, onUpdate, onToggle })

Common pitfalls (and fixes)

  • Animating layout properties (top/left/width/height) → jank
    • Use transforms, add will-change: transform, avoid forced reflow.
  • ScrollTrigger “not firing” due to wrong trigger sizing/overflow containers
    • Ensure trigger exists, has height, and check scroll container (nested scrolling needs config).
  • Not cleaning up in SPA/React
    • Use gsap.context() and revert on unmount; kill triggers (ScrollTrigger.getAll().forEach(t => t.kill())) if needed.
  • FOUC / measuring before fonts/images load
    • Initialize after layout is stable; run ScrollTrigger.refresh() after images load.

Quick recipes

1) Hero entrance (stagger)

gsap.from(".hero [data-anim]", {
  y: 24,
  autoAlpha: 0,
  duration: 0.8,
  ease: "power2.out",
  stagger: 0.06,
});

2) Sequenced timeline

const tl = gsap.timeline({ defaults: { ease: "power2.out", duration: 0.6 } });
tl.from(".nav", { y: -20, autoAlpha: 0 })
  .from(".hero-title", { y: 30, autoAlpha: 0 }, "-=0.2")
  .from(".hero-cta", { scale: 0.95, autoAlpha: 0 }, "-=0.2");

3) Scroll-scrub pinned section

gsap.registerPlugin(ScrollTrigger);

gsap.timeline({
  scrollTrigger: {
    trigger: ".story",
    start: "top top",
    end: "+=800",
    scrub: 1,
    pin: true,
  },
}).to(".story .panel", { xPercent: -200 });

What to ask the user (if requirements unclear)

  • Is this a static site or SPA (React/Next/Vue)? Any page transitions?
  • Do we need scroll-driven sections (pin/scrub/snap)?
  • Performance constraints (mobile support, reduced motion)?
よくある質問

タイムラインとは何ですか?

タイムラインは、各アニメーションが開始するタイミングを制御しながら、順番に再生されるアニメーションの並びです。

widthやtopのアニメーションを避けるのはなぜですか?

それらはページのレイアウトを変えるので、動きがかくつくことがあります。トランスフォームと不透明度の方が滑らかです。

Reactでも使えますか?

はい。スキルはHTML、CSS、JavaScript、Reactを扱います。

詳細

作者による元の説明

Use when you need to add or debug professional web animations with GSAP (timelines, ScrollTrigger, stagger, transforms) in HTML/CSS/JS/React. Includes patterns for smooth motion, performance, and common pitfalls.

repo: MengTo/Skills

人気

GitHubのスター
7.2k
ランキング
#13439
ライセンス
MIT
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル