Communitygithub.com

GSAP アニメーションリファレンス for HyperFrames

HyperFrames のための GSAP アニメーションリファレンス。gsap.to(), from(), fromTo(), イージング, スタガー, デフォルト, タイムライン(gsap.timeline(), 位置パラメータ, ラベル, ネスト, 再生制御), パフォーマンス(トランスフォーム, will-change, quickTo)を網羅。HyperFrames コンポジションでの GSAP アニメーション記述時に使用。

GSAP アニメーションリファレンス for HyperFrames とは?

このスキルは、HyperFrames プロジェクト内で GSAP アニメーションを記述するための包括的リファレンスを提供します。GSAP のコアメソッド(to, from, fromTo, set)、イージング関数、スタガーオプション、プロパティの camelCase 記法、CSS 変数の扱いなどをカバーします。特にタイムライン機能に重点を置いており、gsap.timeline() の作成方法や位置パラメータ、ラベル、ネスト、再生制御について詳しく説明しています。パフォーマンス向上のためのベストプラクティスとして、トランスフォームと opacity の使用推奨、will-change、gsap.quickTo() による頻繁な更新の効率化、スタガーの活用、クリーンアップの重要性などを解説します。このスキルは、開発者が GSAP の強力な機能を効果的に HyperFrames コンポジションに統合し、スムーズでパフォーマンスの高いアニメーションを作成するのに役立ちます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/govindgoel2001/video-editing-toolkit/tree/HEAD/vendor/hyperframes-skills/gsap

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

GSAP

コアトゥイーンメソッド

  • gsap.to(targets, vars) — 現在の状態から vars に向けてアニメーション。最も一般的。
  • gsap.from(targets, vars) — vars から現在の状態に向けてアニメーション(出現)。
  • gsap.fromTo(targets, fromVars, toVars) — 明示的な開始と終了。
  • gsap.set(targets, vars) — 即座に適用(duration 0)。

プロパティ名には必ず camelCase を使用すること(例:backgroundColor, rotationX)。

一般的な vars

  • duration — 秒(デフォルト 0.5)。
  • delay — 開始前の秒数。
  • ease — "power1.out"(デフォルト)、"power3.inOut"、"back.out(1.7)"、"elastic.out(1, 0.3)"、"none"。
  • stagger — 数値 0.1 またはオブジェクト:{ amount: 0.3, from: "center" }、{ each: 0.1, from: "random" }。
  • overwrite — false(デフォルト)、true、または "auto"。
  • repeat — 数値または無限の場合は -1。yoyo — repeat と組み合わせて方向を交互に。
  • onComplete, onStart, onUpdate — コールバック。
  • immediateRender — from()/fromTo() ではデフォルト true。同じプロパティと要素をターゲットにする後続のトゥイーンでは、上書きを避けるために false に設定。

トランスフォームと CSS

生の transform 文字列よりも GSAP の transform エイリアス を推奨:

GSAP プロパティ同等の CSS
x, y, ztranslateX/Y/Z (px)
xPercent, yPercenttranslateX/Y in %
scale, scaleX, scaleYscale
rotationrotate (deg)
rotationX, rotationY3D rotate
skewX, skewYskew
transformOrigintransform-origin
  • autoAlpha — opacity よりも推奨。0 の場合、visibility: hidden も設定。
  • CSS 変数 — "--hue": 180。
  • svgOrigin (SVG のみ) — グローバル SVG 座標空間の原点。transformOrigin と組み合わせないこと。
  • 方向指定回転 — "360_cw", "-170_short", "90_ccw"。
  • clearProps — "all" またはカンマ区切り。完了時にインラインスタイルを削除。
  • 相対値 — "+=20", "-=10", "*=2"。

関数ベースの値

gsap.to(".item", {
  x: (i, target, targets) => i * 50,
  stagger: 0.1,
});

イージング

組み込みイージング: power1–power4, back, bounce, circ, elastic, expo, sine。それぞれ .in, .out, .inOut がある。

デフォルト

gsap.defaults({ duration: 0.6, ease: "power2.out" });

トゥイーンの制御

const tween = gsap.to(".box", { x: 100 });
tween.pause();
tween.play();
tween.reverse();
tween.kill();
tween.progress(0.5);
tween.time(0.2);

gsap.matchMedia()(レスポンシブ + アクセシビリティ)

メディアクエリが一致する場合にのみセットアップを実行し、一致しなくなったら自動的に元に戻す。

let mm = gsap.matchMedia();
mm.add(
  {
    isDesktop: "(min-width: 800px)",
    reduceMotion: "(prefers-reduced-motion: reduce)",
  },
  (context) => {
    const { isDesktop, reduceMotion } = context.conditions;
    gsap.to(".box", {
      rotation: isDesktop ? 360 : 180,
      duration: reduceMotion ? 0 : 2,
    });
  },
);

タイムライン

タイムラインの作成

const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });
tl.to(".a", { x: 100 }).to(".b", { y: 50 }).to(".c", { opacity: 0 });

位置パラメータ

3 番目の引数で配置を制御:

  • 絶対: 1 — 1 秒の位置
  • 相対: "+=0.5" — 終了後;"-=0.2" — 終了前
  • ラベル: "intro"、"intro+=0.3"
  • 整列: "<" — 前のトゥイーンと同じ開始;">" — 前のトゥイーンの終了後;"<0.2" — 前のトゥイーン開始から 0.2 秒後
tl.to(".a", { x: 100 }, 0);
tl.to(".b", { y: 50 }, "<"); // .a と同じ開始
tl.to(".c", { opacity: 0 }, "<0.2"); // .b 開始から 0.2 秒後

ラベル

tl.addLabel("intro", 0);
tl.to(".a", { x: 100 }, "intro");
tl.addLabel("outro", "+=0.5");
tl.play("outro");
tl.tweenFromTo("intro", "outro");

タイムラインオプション

  • paused: true — 一時停止状態で作成;.play() で開始。
  • repeat, yoyo — タイムライン全体に適用。
  • defaults — すべての子トゥイーンにマージされる vars。

タイムラインのネスト

const master = gsap.timeline();
const child = gsap.timeline();
child.to(".a", { x: 100 }).to(".b", { y: 50 });
master.add(child, 0);

再生制御

tl.play(), tl.pause(), tl.reverse(), tl.restart(), tl.time(2), tl.progress(0.5), tl.kill().


パフォーマンス

トランスフォームと opacity を優先

x, y, scale, rotation, opacity のアニメーションはコンポジター上で処理される。トランスフォームで同じ効果が得られる場合、width, height, top, left は避けること。

will-change

will-change: transform;

実際にアニメーションする要素にのみ設定。

頻繁な更新には gsap.quickTo()

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
  yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });
container.addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

多くのトゥイーンよりもスタガー

手動の遅延を持つ個別のトゥイーンではなく、stagger を使用すること。

クリーンアップ

画面外のアニメーションは一時停止または kill すること。


リファレンス(オンデマンドで読み込み)

  • references/effects.md — すぐに使えるエフェクト:タイプライターテキスト、オーディオビジュアライザー。HyperFrames の既成エフェクトパターンが必要な場合に参照。

ベストプラクティス

  • camelCase のプロパティ名を使用し、transform エイリアスと autoAlpha を優先すること。
  • delay でチェーンするよりもタイムラインを優先し、位置パラメータを使用すること。
  • 読みやすいシーケンスのために addLabel() でラベルを追加すること。
  • タイムラインコンストラクタに defaults を渡すこと。
  • 再生を制御する場合は、トゥイーン/タイムラインの戻り値を変数に格納すること。

禁止事項

  • トランスフォームで十分な場合に、レイアウトプロパティ(width/height/top/left)をアニメーションしないこと。
  • 同じ SVG 要素で svgOrigin と transformOrigin の両方を使用しないこと。
  • タイムラインでシーケンス化できる場合に、delay でアニメーションをチェーンしないこと。
  • DOM が存在する前にトゥイーンを作成しないこと。
  • クリーンアップを省略しないこと — 不要になったトゥイーンは必ず kill すること。

Individual skills in this repo

This repo contains 6 individual skills — each has its own dedicated page.

govindgoel2001/video-editing-toolkit

HyperFrames CLI tool — hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting, validating, inspecting visual layout in compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

govindgoel2001/video-editing-toolkit

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

govindgoel2001/video-editing-toolkit

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

govindgoel2001/video-editing-toolkit

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

govindgoel2001/video-editing-toolkit

Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.

govindgoel2001/video-editing-toolkit

Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric/mathematical content.

関連スキル