Agent Skills by ALSEL
Anthropic Claudeその他⭐ リポ 0品質スコア 50/100

gsap-scrolltrigger

GSAPのScrollTriggerプラグインを使用したスクロール連動アニメーションを実装します。ピン留め、スクラブ、スナップポイント、パララックス効果などに対応しており、スクロール駆動のアニメーション、固定セクション、進行状況インジケーター、パララックススクロール表現を作成する際に活用してください。

description の原文を見る

Scroll-based animations using GSAP ScrollTrigger plugin including pinning, scrubbing, snap points, and parallax effects. Use when creating scroll-driven animations, sticky sections, progress indicators, or parallax scrolling experiences.

SKILL.md 本文

GSAP ScrollTrigger

スクロール駆動型のアニメーションと相互作用。

クイックスタート

npm install gsap
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

gsap.to('.box', {
  x: 500,
  scrollTrigger: {
    trigger: '.box',
    start: 'top center',
    end: 'bottom center',
    scrub: true
  }
});

コア概念

基本的な ScrollTrigger

gsap.to('.element', {
  x: 200,
  scrollTrigger: {
    trigger: '.element',  // アニメーションをトリガーする要素
    start: 'top center',  // トリガーがビューポート中央に到達したとき
    end: 'bottom center', // トリガーがビューポート中央を離れたとき
    toggleActions: 'play pause resume reset'
  }
});

開始/終了位置

// フォーマット: "trigger-position viewport-position"
start: 'top center'      // トリガーの上部がビューポート中央に到達
start: 'top 80%'         // トリガーの上部がビューポート下方80%に到達
start: 'center center'   // トリガーの中央がビューポート中央に到達
start: 'bottom top'      // トリガーの下部がビューポート上部に到達
start: 'top top+=100'    // トリガーの上部がビューポート上部から100px下に到達

位置リファレンス

説明
top上端
center中央
bottom下端
80%上から80%
+=100プラス100ピクセル
-=50マイナス50ピクセル

スクラブアニメーション

基本的なスクラブ

// アニメーション進度がスクロール位置に連動
gsap.to('.progress-bar', {
  scaleX: 1,
  scrollTrigger: {
    trigger: '.content',
    start: 'top top',
    end: 'bottom bottom',
    scrub: true  // スクロールに直接リンク
  }
});

スムーズなスクラブ

gsap.to('.element', {
  x: 500,
  scrollTrigger: {
    trigger: '.section',
    scrub: 1,    // 1秒のスムージング
    // scrub: 0.5  // 0.5秒のスムージング
    // scrub: 2    // 2秒のスムージング (遅延感のある動き)
  }
});

タイムラインを使ったスクラブ

const tl = gsap.timeline({
  scrollTrigger: {
    trigger: '.container',
    start: 'top top',
    end: '+=3000',  // スクロール距離
    scrub: 1,
    pin: true
  }
});

tl.to('.step1', { opacity: 1 })
  .to('.step2', { opacity: 1 })
  .to('.step3', { opacity: 1 });

ピニング

基本的なピン

ScrollTrigger.create({
  trigger: '.panel',
  start: 'top top',
  end: '+=500',      // 500pxのスクロール間ピン固定
  pin: true
});

アニメーション付きピン

gsap.to('.content', {
  x: '-200%',
  ease: 'none',
  scrollTrigger: {
    trigger: '.horizontal-section',
    start: 'top top',
    end: () => '+=' + document.querySelector('.horizontal-section').offsetWidth,
    pin: true,
    scrub: 1
  }
});

ピン スペーシング

ScrollTrigger.create({
  trigger: '.section',
  pin: true,
  pinSpacing: true,   // デフォルト: ピン期間のスペースを追加
  // pinSpacing: false  // 余分なスペースなし (コンテンツが重なる)
  // pinSpacing: '500px' // カスタムスペーシング
});

トグルアクション

アクション構文

// フォーマット: "onEnter onLeave onEnterBack onLeaveBack"
toggleActions: 'play pause resume reset'

// よくある組み合わせ:
toggleActions: 'play none none none'     // 一度だけ再生
toggleActions: 'play reverse play reverse' // 方向をトグル
toggleActions: 'restart none none none'  // 毎回リスタート
toggleActions: 'play complete reverse reset'

アクション値

アクション効果
play前方再生
pause一時停止
resume一時停止から再開
reverse逆方向再生
restart最初からリスタート
reset開始位置にリセット (アニメーション無し)
complete終了位置にジャンプ
none何もしない

スナップポイント

基本的なスナップ

ScrollTrigger.create({
  trigger: '.sections',
  start: 'top top',
  end: 'bottom bottom',
  snap: 1 / 4  // 4分の1ずつスナップ
});

ラベルにスナップ

const tl = gsap.timeline({
  scrollTrigger: {
    trigger: '.container',
    scrub: 1,
    snap: {
      snapTo: 'labels',
      duration: 0.5,
      ease: 'power2.inOut'
    }
  }
});

tl.addLabel('intro')
  .to('.a', { opacity: 1 })
  .addLabel('middle')
  .to('.b', { opacity: 1 })
  .addLabel('end');

スナップ設定

snap: {
  snapTo: [0, 0.25, 0.5, 0.75, 1],  // 特定ポイントにスナップ
  duration: { min: 0.2, max: 0.6 }, // スナップ期間の範囲
  delay: 0,                          // スナップ前の遅延
  ease: 'power1.inOut',             // スナップのイージング
  directional: true                  // スクロール方向にスナップ
}

コールバック

ScrollTrigger コールバック

ScrollTrigger.create({
  trigger: '.section',
  onEnter: () => console.log('進入'),
  onLeave: () => console.log('離脱'),
  onEnterBack: () => console.log('下から進入'),
  onLeaveBack: () => console.log('上に向かって離脱'),
  onUpdate: (self) => console.log('進度:', self.progress),
  onToggle: (self) => console.log('アクティブ:', self.isActive),
  onRefresh: () => console.log('更新')
});

進度ベースの更新

ScrollTrigger.create({
  trigger: '.section',
  start: 'top bottom',
  end: 'bottom top',
  onUpdate: (self) => {
    // self.progress: 0 から 1
    // self.direction: 1 (下) または -1 (上)
    // self.velocity: スクロール速度
    updateElement(self.progress);
  }
});

パラレックス効果

基本的なパラレックス

// 背景がスクロールより遅く動く
gsap.to('.background', {
  yPercent: -50,
  ease: 'none',
  scrollTrigger: {
    trigger: '.section',
    scrub: true
  }
});

// 前景がより速く動く
gsap.to('.foreground', {
  yPercent: 50,
  ease: 'none',
  scrollTrigger: {
    trigger: '.section',
    scrub: true
  }
});

マルチレイヤー パラレックス

const layers = [
  { selector: '.layer-1', speed: -20 },
  { selector: '.layer-2', speed: -40 },
  { selector: '.layer-3', speed: -60 },
  { selector: '.layer-4', speed: -80 }
];

layers.forEach(layer => {
  gsap.to(layer.selector, {
    yPercent: layer.speed,
    ease: 'none',
    scrollTrigger: {
      trigger: '.parallax-section',
      start: 'top bottom',
      end: 'bottom top',
      scrub: true
    }
  });
});

水平スクロール

水平セクション

const sections = gsap.utils.toArray('.panel');

gsap.to(sections, {
  xPercent: -100 * (sections.length - 1),
  ease: 'none',
  scrollTrigger: {
    trigger: '.horizontal-container',
    pin: true,
    scrub: 1,
    snap: 1 / (sections.length - 1),
    end: () => '+=' + document.querySelector('.horizontal-container').offsetWidth
  }
});

マーカー (開発)

ScrollTrigger.create({
  trigger: '.section',
  start: 'top center',
  end: 'bottom center',
  markers: true,  // ビジュアルマーカーを表示
  // markers: { startColor: 'green', endColor: 'red', fontSize: '12px' }
});

バッチアニメーション

スクロール時のスタッガー

ScrollTrigger.batch('.card', {
  onEnter: (elements) => {
    gsap.from(elements, {
      opacity: 0,
      y: 50,
      stagger: 0.1,
      duration: 0.5
    });
  },
  start: 'top 85%'
});

バッチ設定

ScrollTrigger.batch('.item', {
  interval: 0.1,  // バッチ間の時間
  batchMax: 3,    // バッチあたりの最大アイテム数
  onEnter: batch => gsap.to(batch, { opacity: 1, y: 0, stagger: 0.1 }),
  onLeave: batch => gsap.to(batch, { opacity: 0, y: 20 }),
  onEnterBack: batch => gsap.to(batch, { opacity: 1, y: 0 }),
  onLeaveBack: batch => gsap.to(batch, { opacity: 0, y: -20 })
});

よくあるパターン

スクロール時の表示

gsap.utils.toArray('.reveal').forEach(elem => {
  gsap.from(elem, {
    opacity: 0,
    y: 50,
    duration: 0.8,
    scrollTrigger: {
      trigger: elem,
      start: 'top 80%',
      toggleActions: 'play none none none'
    }
  });
});

進捗インジケータ

gsap.to('.progress-bar', {
  scaleX: 1,
  transformOrigin: 'left center',
  ease: 'none',
  scrollTrigger: {
    trigger: 'body',
    start: 'top top',
    end: 'bottom bottom',
    scrub: 0.3
  }
});

スティッキーヘッダー変形

ScrollTrigger.create({
  start: 'top -80',
  onUpdate: (self) => {
    if (self.direction === 1) {
      gsap.to('.header', { y: -80, duration: 0.3 });
    } else {
      gsap.to('.header', { y: 0, duration: 0.3 });
    }
  }
});

テンポラル コラプス パターン

カウントダウン スクロール表示

// ユーザーがスクロールするにつれてカウントダウンセクションを表示
const sections = ['days', 'hours', 'minutes', 'seconds'];

sections.forEach((section, i) => {
  gsap.from(`.countdown-${section}`, {
    opacity: 0,
    scale: 0.8,
    y: 50,
    duration: 0.8,
    ease: 'power3.out',
    scrollTrigger: {
      trigger: `.countdown-${section}`,
      start: 'top 80%',
      toggleActions: 'play none none none'
    }
  });
});

スクロールベース時間拡張エフェクト

gsap.timeline({
  scrollTrigger: {
    trigger: '.time-section',
    start: 'top center',
    end: 'bottom center',
    scrub: 1
  }
})
.to('.time-digit', {
  textShadow: '0 0 50px #00F5FF, 0 0 100px #00F5FF',
  scale: 1.1
})
.to('.particles', {
  opacity: 1,
  filter: 'blur(0px)'
}, '<');

パフォーマンスのコツ

// 必要に応じてモバイルで無効化
ScrollTrigger.matchMedia({
  '(min-width: 768px)': function() {
    // デスクトップアニメーション
  },
  '(max-width: 767px)': function() {
    // よりシンプルなモバイルアニメーション
  }
});

// リサイズ時に更新
ScrollTrigger.refresh();

// すべての ScrollTrigger を削除
ScrollTrigger.killAll();

// 特定のトリガーを削除
const st = ScrollTrigger.create({ ... });
st.kill();

リファレンス

  • アニメーションの基礎については gsap-fundamentals を参照
  • タイムラインの構成については gsap-sequencing を参照
  • ScrollTrigger の React 統合については gsap-react を参照

ライセンス: MIT(寛容ライセンスのため全文を引用しています) · 原本リポジトリ

詳細情報

作者
bbeierle12
リポジトリ
bbeierle12/skill-mcp-claude
ライセンス
MIT
最終更新
不明

Source: https://github.com/bbeierle12/skill-mcp-claude / ライセンス: MIT

関連スキル

汎用その他⭐ リポ 1,982

superfluid

Superfluidプロトコルおよびそのエコシステムに関するナレッジベースです。Superfluidについて情報を検索する際は、ウェブ検索の前にこちらを参照してください。対応キーワード:Superfluid、CFA、GDA、Super App、Super Token、stream、flow rate、real-time balance、pool(member/distributor)、IDA、sentinels、liquidation、TOGA、@sfpro/sdk、semantic money、yellowpaper、whitepaper

by LeoYeAI
汎用その他⭐ リポ 100

civ-finish-quotes

実質的なタスクが真に完了した際に、文明風の儀式的な引用句を追加します。ユーザーやエージェントが機能追加、リファクタリング、分析、設計ドキュメント、プロセス改善、レポート、執筆タスクといった実際の成果物を完成させるときに、明示的な依頼がなくても使用します。短い返信や小さな修正、未完成の作業には適用しません。

by huxiuhan
汎用その他⭐ リポ 1,110

nookplot

Base(Ethereum L2)上のAIエージェント向け分散型調整ネットワークです。エージェントがオンチェーンアイデンティティを登録する、コンテンツを公開する、他のエージェントにメッセージを送る、マーケットプレイスで専門家を雇う、バウンティを投稿・請求する、レピュテーションを構築する、共有プロジェクトで協業する、リサーチチャレンジを解くことでNOOKをマイニングする、キュレーションされたナレッジを備えたスタンドアロンオンチェーンエージェントをデプロイする、またはアグリーメントとリワードで収益を得る場合に利用できます。エージェントネットワーク、エージェント調整、分散型エージェント、NOOKトークン、マイニングチャレンジ、ナレッジバンドル、エージェントレピュテーション、エージェントマーケットプレイス、ERC-2771メタトランザクション、Prepare-Sign-Relay、AgentFactory、またはNookplotが言及された場合にトリガーされます。

by BankrBot
汎用その他⭐ リポ 59

web3-polymarket

Polygon上でのPolymarket予測市場取引統合です。認証機能(L1 EIP-712、L2 HMAC-SHA256、ビルダーヘッダー)、注文発注(GTC/GTD/FOK/FAK、バッチ、ポストオンリー、ハートビート)、市場データ(Gamma API、Data API、オーダーブック、サブグラフ)、WebSocketストリーミング(市場・ユーザー・スポーツチャネル)、CTF操作(分割、統合、償却、ネガティブリスク)、ブリッジ機能(入金、出金、マルチチェーン)、およびガスレスリレイトランザクションに対応しています。AIエージェント、自動マーケットメーカー、予測市場UI、またはPolygraph上のPolymarketと統合するアプリケーション構築時に活用できます。

by elophanto
汎用その他⭐ リポ 52

ethskills

Ethereum、EVM、またはブロックチェーン関連のリクエストに対応します。スマートコントラクト、dApps、ウォレット、DeFiプロトコルの構築、監査、デプロイ、インタラクションに適用されます。Solidityの開発、コントラクトアドレス、トークン規格(ERC-20、ERC-721、ERC-4626など)、Layer 2ネットワーク(Base、Arbitrum、Optimism、zkSync、Polygon)、Uniswap、Aave、Curveなどのプロトコルとの統合をカバーします。ガスコスト、コントラクトのデシマル設定、オラクルセキュリティ、リエントランシー、MEV、ブリッジング、ウォレット管理、オンチェーンデータの取得、本番環境へのデプロイ、プロトコル進化(EIPライフサイクル、フォーク追跡、今後の変更予定)といったトピックを含みます。

by jiayaoqijia
汎用その他⭐ リポ 44

xxyy-trade

このスキルは、ユーザーが「トークン購入」「トークン売却」「トークンスワップ」「暗号資産取引」「取引ステータス確認」「トランザクション照会」「トークンスキャン」「フィード」「チェーン監視」「トークン照会」「トークン詳細」「トークン安全性確認」「ウォレット一覧表示」「マイウォレット」「AIスキャン」「自動スキャン」「ツイートスキャン」「オンボーディング」「IP確認」「IPホワイトリスト」「トークン発行」「自動売却」「損切り」「利益確定」「トレーリングストップ」「保有者」「トップホルダー」「KOLホルダー」などをリクエストした場合、またはSolana/ETH/BSC/BaseチェーンでXXYYを経由した取引について言及した場合に使用します。XXYY Open APIを通じてオンチェーン取引とデータ照会を実現します。

by Jimmy-Holiday
本サイトは GitHub 上で公開されているオープンソースの SKILL.md ファイルをクロール・インデックス化したものです。 各スキルの著作権は原作者に帰属します。掲載に問題がある場合は info@alsel.co.jp または /takedown フォームよりご連絡ください。
原作者: bbeierle12 · bbeierle12/skill-mcp-claude · ライセンス: MIT