mcpField
G
gsap-router

gsap-router

github.com/bbeierle12设计与 UI9100 次安装1 天前更新
代码仓库

关于 gsap-router

按需求信号、复杂度和框架选择 GSAP 动画技能的路由指南,帮助开发者在实现前组合相关参考。

主要功能

  1. 01路由至四种 GSAP 技能
  2. 02按动画术语匹配技能
  3. 03评估路由置信度
  4. 04推荐技能组合
  5. 05提供框架与任务决策表

适用场景

  1. 01选择滚动动画的参考技能
  2. 02规划 React 组件动画序列
  3. 03为交互式 UI 动画选择技能

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/bbeierle12/skill-mcp-claude --skill gsap-router

安装后在 Claude Code 中输入/gsap-router确认已加载。

附带文件_meta.json

详细介绍

GSAP 路由器

根据动画需求路由至 4 个专用技能。

路由协议

  1. 分类 — 根据用户请求识别动画类型
  2. 匹配 — 应用下方的信号匹配规则
  3. 组合 — 生产级动画通常需要组合 2-3 个技能
  4. 加载 — 实现前读取匹配技能的 SKILL.md 文件

快速路由

第 1 层:核心(从这里开始)
需求技能信号
基础动画、缓动gsap-fundamentalstween, animate, ease, from, to, duration, delay
复杂序列gsap-sequencingtimeline, sequence, orchestrate, labels, callbacks
滚动动画gsap-scrolltriggerscroll, pin, scrub, parallax, reveal, sticky
React 集成gsap-reactReact, useGSAP, ref, hook, cleanup, context

信号匹配

主要信号

gsap-fundamentals:

  • “animate”、“tween”、“transition”
  • “ease”、“easing”、“timing”
  • “from”、“to”、“fromTo”
  • “duration”、“delay”、“repeat”
  • “stagger”、“properties”

gsap-sequencing:

  • “timeline”、“sequence”、“orchestrate”
  • “labels”、“callbacks”、“nested”
  • “position parameter”、“overlap”
  • “complex animation”、“choreography”
  • “play”、“pause”、“reverse”、“seek”

gsap-scrolltrigger:

  • “scroll”、“ScrollTrigger”
  • “pin”、“sticky”、“fixed”
  • “scrub”、“parallax”
  • “reveal on scroll”、“snap”
  • “progress indicator”

gsap-react:

  • “React”、“component”
  • “useGSAP”、“useRef”、“hook”
  • “cleanup”、“context”
  • “event handler”、“state”
置信度评分
  • 高(3 个以上信号) — 直接路由至匹配的技能
  • 中(1-2 个信号) — 以 fundamentals 为基础进行路由
  • 低(0 个信号) — 从 gsap-fundamentals 开始

常见组合

基础动画(1 个技能)
gsap-fundamentals → Tweens, easing, basic properties
React 组件动画(2 个技能)
gsap-fundamentals → Animation principles, easing
gsap-react → Hook patterns, cleanup, refs
基于滚动的体验(3 个技能)
gsap-scrolltrigger → Scroll triggers, pinning
gsap-sequencing → Timeline for pinned sections
gsap-fundamentals → Individual animations
完整生产级方案(3-4 个技能)
gsap-fundamentals → Core animations
gsap-sequencing → Complex orchestration
gsap-react → Framework integration
gsap-scrolltrigger → Scroll interactions (if needed)

决策表

框架动画类型复杂度路由至
Vanilla JS简单低fundamentals
Vanilla JS序列动画中fundamentals + sequencing
Vanilla JS基于滚动中fundamentals + scrolltrigger
React简单低fundamentals + react
React复杂高全部四个技能
React滚动中react + scrolltrigger

动画类别

运动类型 → 技能映射
动画类型主要技能辅助技能
淡入/淡出gsap-fundamentals-
滑动/移动gsap-fundamentals-
缩放/旋转gsap-fundamentals-
交错动画gsap-fundamentals-
页面过渡gsap-sequencingfundamentals
编排式显现gsap-sequencingfundamentals
滚动显现gsap-scrolltriggerfundamentals
视差gsap-scrolltrigger-
固定区段gsap-scrolltriggersequencing
React 动画gsap-reactfundamentals
React + 滚动gsap-reactscrolltrigger

与其他领域集成

与 R3F(r3f-*)集成
r3f-fundamentals → 3D scene setup
gsap-fundamentals → Object property animation
gsap-sequencing → Camera movements, scene transitions

GSAP 通过 onUpdate 为 Three.js 对象属性添加动画。

与后期处理(postfx-*)集成
postfx-composer → Effect setup
gsap-fundamentals → Animate effect parameters
gsap-sequencing → Transition between effect states

GSAP 驱动效果强度、颜色等。

与音频(audio-*)集成
audio-playback → Music timing
gsap-sequencing → Sync animations to audio cues
gsap-fundamentals → Audio-reactive property changes

时间线回调与音频事件同步。

与粒子(particles-*)集成
particles-systems → Particle emitters
gsap-fundamentals → Animate emitter properties
gsap-sequencing → Particle burst sequences

工作流模式

页面加载动画
1. gsap-fundamentals → Understand tweens, easing
2. gsap-sequencing → Build entrance timeline
3. gsap-react → Integrate with React (if applicable)
滚动体验
1. gsap-scrolltrigger → Set up triggers, pins
2. gsap-sequencing → Build scrubbed timelines
3. gsap-fundamentals → Individual animation properties
交互式 UI
1. gsap-fundamentals → Hover, click animations
2. gsap-react → Event handlers, cleanup
3. gsap-sequencing → Complex interaction sequences

时间坍缩动画栈

适用于新年倒计时项目:

gsap-fundamentals → Digit animations, pulse effects, easing
gsap-sequencing → Countdown sequence, final moment orchestration
gsap-react → Component integration, cleanup

关键动画:

  • 时间变化时数字翻转
  • 脉冲/辉光强度随时间变化
  • 最后倒计时的戏剧性序列
  • 到零时呈现庆祝效果

快速参考

任务 → 技能
任务主要次要
“为此元素添加动画”fundamentals-
“创建入场动画”fundamentalsreact
“构建页面过渡”sequencingfundamentals
“滚动时添加动画”scrolltriggerfundamentals
“React 组件动画”reactfundamentals
“固定滚动区域”scrolltriggersequencing
“复杂动画序列”sequencingfundamentals
“列表交错动画”fundamentalsreact
缓动速查
感觉缓动
灵敏的 UIpower2.out
平滑入场power3.out
活泼弹跳back.out(1.7)
弹簧感elastic.out
球体下落bounce.out
线性/机械感none

回退行为

  • 未指定框架 → 假设使用原生 JS,从 gsap-fundamentals 开始
  • 提到 React → 将 gsap-react 加入组合
  • 提到滚动 → 将 gsap-scrolltrigger 加入组合
  • 提到“复杂”或“序列” → 将 gsap-sequencing 加入组合
  • 需求不明确 → 从 gsap-fundamentals 开始

性能优先级

性能至关重要时:

  1. gsap-fundamentals — 使用变换,避免布局属性
  2. gsap-react — 正确清理可防止内存泄漏
  3. gsap-scrolltrigger — 明智地使用 scrub,批量更新
  4. gsap-sequencing — 复用时间线,不要重新创建

评论

支持 Markdown