Communitygithub.com

Geruyang/agent-skills-library

HyperFrames向けGSAPアニメーションリファレンス。gsap.to(), from(), fromTo(), イージング、スタガー、デフォルト、タイムライン(gsap.timeline(), 位置パラメータ、ラベル、ネスト、再生制御)、パフォーマンス(トランスフォーム、will-change、quickTo)をカバー。HyperFramesコンポジションでGSAPアニメーションを記述する際に使用します。

agent-skills-library とは?

このスキルは、HyperFramesコンポジション内でGSAPアニメーションを記述するための包括的なリファレンスを提供します。GSAPのコアメソッド(gsap.to、from、fromTo、set)、一般的なvars(duration、delay、ease、stagger、repeatなど)、変換プロパティとCSSプロパティ(x、y、scale、rotation、autoAlphaなど)、関数ベースの値、イージング、デフォルト設定、tweenの制御方法について詳細に説明しています。また、gsap.matchMedia()を使用したレスポンシブ対応とアクセシビリティ、タイムラインの作成と管理(位置パラメータ、ラベル、ネスト、再生制御)、パフォーマンス最適化のベストプラクティス(トランスフォームと不透明度の優先、will-changeの使用、gsap.quickTo()の活用、スタガーによる効率化、クリーンアップ)もカバーしています。このスキルは、HyperFramesプラットフォーム上でGSAPを効率的に使用するための実用的なガイドであり、開発者がアニメーションのパフォーマンスを最大化し、コードの可読性を高めるのに役立ちます。参照ファイルとしてreferences/effects.mdも含まれており、タイプライターエフェクトやオーディオビジュアライザーなどの即席エフェクトパターンを提供します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Geruyang/agent-skills-library/tree/HEAD/original-skills/x-openai-gsap-646176d

お気に入りの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のトランスフォームエイリアスを優先してください:

GSAPプロパティ同等のCSS
x、y、ztranslateX/Y/Z (px)
xPercent、yPercenttranslateX/Y (%)
scale、scaleX、scaleYスケール
rotation回転 (deg)
rotationX、rotationY3D回転
skewX、skewYスキュー
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()。


パフォーマンス

トランスフォームと不透明度を優先

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を使用してください。

クリーンアップ

画面外のアニメーションは一時停止または強制終了します。


参照(オンデマンドで読み込み)

  • references/effects.md — 即席エフェクト:タイプライターテキスト、オーディオビジュアライザー。HyperFrames用の既製エフェクトパターンが必要な場合に読んでください。

ベストプラクティス

  • プロパティ名はcamelCaseを使用;トランスフォームエイリアスとautoAlphaを優先します。
  • delayを使用したチェーンよりもタイムラインを優先;位置パラメータを使用します。
  • 読みやすいシーケンスのためにaddLabel()でラベルを追加します。
  • デフォルトをタイムラインコンストラクターに渡します。
  • 再生制御が必要な場合は、トゥイーン/タイムラインの戻り値を保存します。

禁止事項

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

Individual skills in this repo

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

Geruyang/agent-skills-library

Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.

Geruyang/agent-skills-library

Set up Tailwind CSS v4 in Expo with react-native-css and NativeWind v5 for universal styling

Geruyang/agent-skills-library

Use for new frontend applications, dashboards, games, creative websites, hero sections, and visually driven UI from scratch, or when the user explicitly asks for a redesign/restyle/modernization. Builds from clean, airy, high-taste, readable image-generated concept design with section-specific references, faithful implementation, and browser testing.

Geruyang/agent-skills-library

Use when testing, debugging, or making targeted improvements to rendered frontend apps through the Build Web Apps or web dev plugin: local dev servers, UI regressions, interaction bugs, console errors, responsive layout, and visual QA. Check whether the Browser plugin is available and use it first when it is; otherwise use regular Playwright with the recorded reason.

Geruyang/agent-skills-library

Design UI surfaces for browser games. Use when the user asks for HUDs, menus, overlays, responsive layouts, or visual direction that must protect the playfield.

Geruyang/agent-skills-library

Guide for building, configuring, and deploying microfrontends on Vercel. Use this skill when the user mentions microfrontends, multi-zones, splitting an app across teams, independent deployments, cross-app routing, incremental migration, composing multiple frontends under one domain, microfrontends.json, @vercel/microfrontends, the microfrontends local proxy, or path-based routing between Vercel projects. Also use when the user asks about shared layouts across projects, navigation between microfrontends, fallback environments, asset prefixes, or feature flag controlled routing.

Geruyang/agent-skills-library

Next.js App Router expert guidance. Use when building, debugging, or architecting Next.js applications — routing, Server Components, Server Actions, Cache Components, layouts, middleware/proxy, data fetching, rendering strategies, and deployment on Vercel.

Geruyang/agent-skills-library

Use when sizing Public Equity Investing positions, finding equity hedges, or building an integrated position-and-hedge risk plan from a listed-equity thesis. Do not use for thesis construction, standalone event underwriting, trade execution, personal investment advice, or credit-instrument risk.

Geruyang/agent-skills-library

Integrate data visualizations into React and Next.js applications. Use when the user needs chart components, UML-like or architecture diagram components, React integration patterns, Next.js client or server boundaries, hydration-safe rendering, lazy loading, framework-aware performance, scroll-driven visual stories, or export guidance.

Geruyang/agent-skills-library

shadcn/ui expert guidance — CLI, component installation, composition patterns, custom registries, theming, Tailwind CSS integration, and high-quality interface design. Use when initializing shadcn, adding components, composing product UI, building custom registries, configuring themes, or troubleshooting component issues.

Geruyang/agent-skills-library

v0 by Vercel expert guidance. Use when discussing AI code generation, generating UI components from prompts, v0 CLI usage, v0 SDK/API integration, or integrating v0 into development workflows with GitHub and Vercel deployment.

Geruyang/agent-skills-library

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", or "switch to --preset".

関連スキル