gsap-router
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGSAP Router
GSAP 路由工具
Routes to 4 specialized skills based on animation requirements.
根据动画需求路由到4个专业技能模块。
Routing Protocol
路由规则
- Classify — Identify animation type from user request
- Match — Apply signal matching rules below
- Combine — Production animations often need 2-3 skills together
- Load — Read matched SKILL.md files before implementation
- 分类 — 从用户需求中识别动画类型
- 匹配 — 应用下方的信号匹配规则
- 组合 — 生产环境中的动画通常需要结合2-3个技能模块
- 加载 — 实现前先读取匹配到的SKILL.md文件
Quick Route
快速路由
Tier 1: Core (Start Here)
第一层级:核心模块(从这里开始)
| Need | Skill | Signals |
|---|---|---|
| Basic animations, easing | | tween, animate, ease, from, to, duration, delay |
| Complex sequences | | timeline, sequence, orchestrate, labels, callbacks |
| Scroll animations | | scroll, pin, scrub, parallax, reveal, sticky |
| React integration | | React, useGSAP, ref, hook, cleanup, context |
| 需求 | 技能 | 信号 |
|---|---|---|
| 基础动画、缓动效果 | | tween, animate, ease, from, to, duration, delay |
| 复杂序列动画 | | timeline, sequence, orchestrate, labels, callbacks |
| 滚动触发动画 | | scroll, pin, scrub, parallax, reveal, sticky |
| React集成动画 | | React, useGSAP, ref, hook, cleanup, context |
Signal Matching
信号匹配
Primary Signals
主要信号
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"
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"
Confidence Scoring
置信度评分
- High (3+ signals) — Route directly to matched skill
- Medium (1-2 signals) — Route with fundamentals as foundation
- Low (0 signals) — Start with
gsap-fundamentals
- 高置信度(3个及以上信号) — 直接路由到匹配的技能模块
- 中置信度(1-2个信号) — 以基础模块为核心进行路由
- 低置信度(0个信号) — 从开始
gsap-fundamentals
Common Combinations
常见组合
Basic Animation (1 skill)
基础动画(1个技能模块)
gsap-fundamentals → Tweens, easing, basic propertiesgsap-fundamentals → Tweens, easing, basic propertiesReact Component Animation (2 skills)
React组件动画(2个技能模块)
gsap-fundamentals → Animation principles, easing
gsap-react → Hook patterns, cleanup, refsgsap-fundamentals → Animation principles, easing
gsap-react → Hook patterns, cleanup, refsScroll-Based Experience (3 skills)
基于滚动的交互体验(3个技能模块)
gsap-scrolltrigger → Scroll triggers, pinning
gsap-sequencing → Timeline for pinned sections
gsap-fundamentals → Individual animationsgsap-scrolltrigger → Scroll triggers, pinning
gsap-sequencing → Timeline for pinned sections
gsap-fundamentals → Individual animationsFull Production (3-4 skills)
全生产环境动画(3-4个技能模块)
gsap-fundamentals → Core animations
gsap-sequencing → Complex orchestration
gsap-react → Framework integration
gsap-scrolltrigger → Scroll interactions (if needed)gsap-fundamentals → Core animations
gsap-sequencing → Complex orchestration
gsap-react → Framework integration
gsap-scrolltrigger → Scroll interactions (if needed)Decision Table
决策表
| Framework | Animation Type | Complexity | Route To |
|---|---|---|---|
| Vanilla JS | Simple | Low | fundamentals |
| Vanilla JS | Sequenced | Medium | fundamentals + sequencing |
| Vanilla JS | Scroll-based | Medium | fundamentals + scrolltrigger |
| React | Simple | Low | fundamentals + react |
| React | Complex | High | All four skills |
| React | Scroll | Medium | react + scrolltrigger |
| 框架 | 动画类型 | 复杂度 | 路由目标 |
|---|---|---|---|
| Vanilla JS | 简单动画 | 低 | fundamentals |
| Vanilla JS | 序列动画 | 中 | fundamentals + sequencing |
| Vanilla JS | 滚动触发动画 | 中 | fundamentals + scrolltrigger |
| React | 简单动画 | 低 | fundamentals + react |
| React | 复杂动画 | 高 | 全部四个技能模块 |
| React | 滚动动画 | 中 | react + scrolltrigger |
Animation Categories
动画分类
Motion Type → Skill Mapping
动画类型 → 技能映射
| Animation Type | Primary Skill | Supporting Skill |
|---|---|---|
| Fade in/out | | - |
| Slide/move | | - |
| Scale/rotate | | - |
| Stagger | | - |
| Page transitions | | fundamentals |
| Orchestrated reveals | | fundamentals |
| Scroll reveals | | fundamentals |
| Parallax | | - |
| Pinned sections | | sequencing |
| React animations | | fundamentals |
| React + scroll | | scrolltrigger |
| 动画类型 | 核心技能模块 | 辅助技能模块 |
|---|---|---|
| 淡入/淡出 | | - |
| 滑动/移动 | | - |
| 缩放/旋转 | | - |
| 交错动画 | | - |
| 页面过渡 | | fundamentals |
| 协同展示动画 | | fundamentals |
| 滚动展示动画 | | fundamentals |
| 视差动画 | | - |
| 固定滚动区块 | | sequencing |
| React动画 | | fundamentals |
| React + 滚动动画 | | scrolltrigger |
Integration with Other Domains
与其他领域的集成
With R3F (r3f-*)
与R3F集成(r3f-*)
r3f-fundamentals → 3D scene setup
gsap-fundamentals → Object property animation
gsap-sequencing → Camera movements, scene transitionsGSAP animates Three.js object properties via .
onUpdater3f-fundamentals → 3D scene setup
gsap-fundamentals → Object property animation
gsap-sequencing → Camera movements, scene transitionsGSAP通过方法为Three.js对象的属性添加动画。
onUpdateWith Post-Processing (postfx-*)
与后期处理集成(postfx-*)
postfx-composer → Effect setup
gsap-fundamentals → Animate effect parameters
gsap-sequencing → Transition between effect statesGSAP drives effect intensity, colors, etc.
postfx-composer → Effect setup
gsap-fundamentals → Animate effect parameters
gsap-sequencing → Transition between effect statesGSAP驱动特效的强度、颜色等参数变化。
With Audio (audio-*)
与音频集成(audio-*)
audio-playback → Music timing
gsap-sequencing → Sync animations to audio cues
gsap-fundamentals → Audio-reactive property changesTimeline callbacks sync with audio events.
audio-playback → Music timing
gsap-sequencing → Sync animations to audio cues
gsap-fundamentals → Audio-reactive property changes时间线回调与音频事件同步。
With Particles (particles-*)
与粒子系统集成(particles-*)
particles-systems → Particle emitters
gsap-fundamentals → Animate emitter properties
gsap-sequencing → Particle burst sequencesparticles-systems → Particle emitters
gsap-fundamentals → Animate emitter properties
gsap-sequencing → Particle burst sequencesWorkflow Patterns
工作流模式
Page Load Animation
页面加载动画
1. gsap-fundamentals → Understand tweens, easing
2. gsap-sequencing → Build entrance timeline
3. gsap-react → Integrate with React (if applicable)1. gsap-fundamentals → 理解补间动画、缓动效果
2. gsap-sequencing → 构建入场时间线
3. gsap-react → 与React集成(如适用)Scroll Experience
滚动交互体验
1. gsap-scrolltrigger → Set up triggers, pins
2. gsap-sequencing → Build scrubbed timelines
3. gsap-fundamentals → Individual animation properties1. gsap-scrolltrigger → 设置触发器、固定元素
2. gsap-sequencing → 构建可 scrub 的时间线
3. gsap-fundamentals → 配置单个动画属性Interactive UI
交互式UI动画
1. gsap-fundamentals → Hover, click animations
2. gsap-react → Event handlers, cleanup
3. gsap-sequencing → Complex interaction sequences1. gsap-fundamentals → 悬停、点击动画
2. gsap-react → 事件处理、资源清理
3. gsap-sequencing → 复杂交互序列Temporal Collapse Stack
倒计时项目示例栈
For the New Year countdown project:
gsap-fundamentals → Digit animations, pulse effects, easing
gsap-sequencing → Countdown sequence, final moment orchestration
gsap-react → Component integration, cleanupKey animations:
- Digit flip on time change
- Pulse/glow intensity over time
- Final countdown dramatic sequence
- Celebration reveal at zero
针对新年倒计时项目:
gsap-fundamentals → Digit animations, pulse effects, easing
gsap-sequencing → Countdown sequence, final moment orchestration
gsap-react → Component integration, cleanup核心动画:
- 时间变化时的数字翻转效果
- 随时间变化的脉冲/发光强度
- 倒计时最后阶段的戏剧性序列
- 归零后的庆祝展示动画
Quick Reference
快速参考
Task → Skills
任务 → 技能模块
| Task | Primary | Secondary |
|---|---|---|
| "Animate this element" | fundamentals | - |
| "Create entrance animation" | fundamentals | react |
| "Build page transition" | sequencing | fundamentals |
| "Animate on scroll" | scrolltrigger | fundamentals |
| "React component animation" | react | fundamentals |
| "Pinned scroll section" | scrolltrigger | sequencing |
| "Complex animation sequence" | sequencing | fundamentals |
| "Staggered list animation" | fundamentals | react |
| 任务 | 核心模块 | 辅助模块 |
|---|---|---|
| "为这个元素添加动画" | fundamentals | - |
| "创建入场动画" | fundamentals | react |
| "构建页面过渡效果" | sequencing | fundamentals |
| "实现滚动触发动画" | scrolltrigger | fundamentals |
| "React组件动画" | react | fundamentals |
| "固定滚动区块" | scrolltrigger | sequencing |
| "复杂动画序列" | sequencing | fundamentals |
| "列表交错动画" | fundamentals | react |
Easing Quick Reference
缓动函数快速参考
| Feel | Ease |
|---|---|
| Snappy UI | |
| Smooth entrance | |
| Playful bounce | |
| Springy | |
| Ball drop | |
| Linear/mechanical | |
| 效果感受 | 缓动函数 |
|---|---|
| 灵敏UI | |
| 平滑入场 | |
| 趣味弹跳 | |
| 弹性效果 | |
| 落体弹跳 | |
| 线性/机械感 | |
Fallback Behavior
回退规则
- No framework stated → Assume vanilla JS, start with
gsap-fundamentals - React mentioned → Add to combination
gsap-react - Scroll mentioned → Add
gsap-scrolltrigger - "Complex" or "sequence" → Add
gsap-sequencing - Unclear requirements → Start with
gsap-fundamentals
- 未指定框架 → 默认为Vanilla JS,从开始
gsap-fundamentals - 提到React → 在组合中加入
gsap-react - 提到滚动 → 在组合中加入
gsap-scrolltrigger - 提到“复杂”或“序列” → 在组合中加入
gsap-sequencing - 需求不明确 → 从开始
gsap-fundamentals
Performance Priority
性能优化要点
When performance is critical:
- — Use transforms, avoid layout properties
gsap-fundamentals - — Proper cleanup prevents memory leaks
gsap-react - — Use
gsap-scrolltriggerwisely, batch updatesscrub - — Reuse timelines, don't recreate
gsap-sequencing
当性能要求较高时:
- — 使用transform属性,避免影响布局的属性
gsap-fundamentals - — 正确的资源清理避免内存泄漏
gsap-react - — 合理使用
gsap-scrolltrigger,批量更新scrub - — 复用时间线,避免重复创建
gsap-sequencing