gsap-animation-helper
Expert guidance for GSAP animations. Use when users want to create smooth animations, build interactive timelines, implement scroll-triggered effects, or work with GSAP plugins. Helps with Tweens, Timelines, ScrollTrigger, and other GSAP features across vanilla JS, React, Next.js, and other frameworks.
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- gsap-animation-helper
- description
- Expert guidance for GSAP animations. Use when users want to create smooth animations, build interactive timelines, implement scroll-triggered effects, or work with GSAP plugins. Helps with Tweens, Timelines, ScrollTrigger, and other GSAP features across vanilla JS, React, Next.js, and other frameworks.
02 资源文件 24
- 脚本examples/basic-tween.js1.9 KB
- 其他examples/next-js-setup.jsx7.9 KB
- 其他examples/react-timeline.jsx3.1 KB
- 参考文档examples/README.md4.4 KB
- 脚本examples/scroll-trigger.js4.9 KB
- 参考文档frameworks/nextjs.md6.2 KB
- 参考文档frameworks/react.md5.8 KB
- 参考文档frameworks/vanilla.md6.5 KB
- 许可证LICENSE.txt1.2 KB
- 参考文档plugins/draggable.md5.7 KB
- 参考文档plugins/draw-svg.md3.1 KB
- 参考文档plugins/flip.md4.4 KB
- 参考文档plugins/morph-svg.md4.1 KB
- 参考文档plugins/motion-path.md4.7 KB
- 参考文档plugins/observer.md5.7 KB
- 参考文档plugins/physics.md5.0 KB
- 参考文档plugins/scroll-smoother.md3.8 KB
- 参考文档plugins/scroll-trigger.md5.4 KB
- 参考文档plugins/split-text.md4.3 KB
- 参考文档plugins/text-plugins.md4.6 KB
- 参考文档README.md4.4 KB
- 参考文档reference/core-methods.md6.5 KB
- 参考文档reference/easing.md5.8 KB
- 参考文档reference/utilities.md6.3 KB
03 SKILL.md 正文
GSAP Animation Helper Skill
A comprehensive guide for creating professional-grade animations using GSAP (GreenSock Animation Platform).
When to Use This Skill
Trigger conditions:
- User mentions "GSAP" or "GreenSock"
- User wants to create animations: "smooth animation", "fade in effect", "scroll animation"
- User mentions specific GSAP features: "Timeline", "Tween", "ScrollTrigger", "stagger"
- User is struggling with animation performance or timing
- User wants to integrate GSAP into React, Next.js, or other frameworks
Quick Decision Tree
What does the user want to do?
Basic Animation
→ Read: reference/core-methods.md
Scroll-based Animation
→ Read: plugins/scroll-trigger.md
→ Smooth scroll needed? Also read: plugins/scroll-smoother.md
Text Animation
→ Character/word split: plugins/split-text.md
→ Typewriter/scramble: plugins/text-plugins.md
SVG Animation
→ Stroke drawing: plugins/draw-svg.md
→ Shape morphing: plugins/morph-svg.md
→ Path following: plugins/motion-path.md
User Interaction
→ Draggable elements: plugins/draggable.md
→ Input handling (wheel/touch/pointer): plugins/observer.md
Layout Animation
→ FLIP technique: plugins/flip.md
Physics-based
→ Read: plugins/physics.md
Framework-specific
→ React: frameworks/react.md
→ Next.js: frameworks/nextjs.md
→ Vanilla JS: frameworks/vanilla.md
Easing/Timing
→ Read: reference/easing.md
Utility Functions
→ Read: reference/utilities.md
Core Concepts (Essential)
Installation
npm install gsap
import gsap from "gsap";
Tween - Basic Animation
// Animate TO a state
gsap.to(".box", { duration: 1, x: 100, opacity: 0.5 });
// Animate FROM a state
gsap.from(".box", { duration: 1, y: -50, opacity: 0 });
// Animate FROM one state TO another
gsap.fromTo(".box", { opacity: 0 }, { duration: 1, opacity: 1 });
Timeline - Sequence Animations
const tl = gsap.timeline();
tl.to(".box1", { duration: 1, x: 100 })
.to(".box2", { duration: 1, x: 100 }) // After box1
.to(".box3", { duration: 1, x: 100 }, "<") // Same time as box2
.to(".box4", { duration: 1, x: 100 }, "-=0.5"); // 0.5s before previous ends
Stagger - Animate Multiple Elements
gsap.to(".item", {
duration: 0.5,
y: 20,
opacity: 1,
stagger: 0.1 // 0.1s delay between each
});
Plugin Registration
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
Common Patterns
Fade In on Load
gsap.from(".element", { duration: 0.6, opacity: 0, y: 20 });
Scroll-triggered Fade In
gsap.from(".element", {
opacity: 0,
y: 50,
duration: 1,
scrollTrigger: {
trigger: ".element",
start: "top 80%"
}
});
Staggered List
gsap.from(".list-item", {
opacity: 0,
y: 20,
duration: 0.5,
stagger: 0.1
});
Hover Animation
const box = document.querySelector(".box");
box.addEventListener("mouseenter", () => gsap.to(box, { scale: 1.1, duration: 0.3 }));
box.addEventListener("mouseleave", () => gsap.to(box, { scale: 1, duration: 0.3 }));
Performance Tips
- Use transforms (
x,y,scale,rotation) instead ofleft,top,width - Use
opacity- GPU accelerated - Avoid animating
box-shadow- expensive - Use
will-change: transformCSS for animated elements - Kill unused tweens:
gsap.killTweensOf(".element")
File Structure
gsap-skill/
├── SKILL.md # This file (entry point)
├── plugins/
│ ├── scroll-trigger.md # ScrollTrigger plugin
│ ├── scroll-smoother.md # ScrollSmoother plugin
│ ├── split-text.md # SplitText plugin
│ ├── flip.md # Flip plugin
│ ├── draggable.md # Draggable + Inertia
│ ├── observer.md # Observer plugin
│ ├── draw-svg.md # DrawSVG plugin
│ ├── morph-svg.md # MorphSVG plugin
│ ├── motion-path.md # MotionPath plugin
│ ├── text-plugins.md # Text + ScrambleText plugins
│ └── physics.md # Physics2D + PhysicsProps
├── frameworks/
│ ├── react.md # React + useGSAP
│ ├── nextjs.md # Next.js SSR handling
│ └── vanilla.md # Vanilla JS patterns
├── reference/
│ ├── core-methods.md # gsap.to, set, quickTo, etc.
│ ├── utilities.md # gsap.utils methods
│ └── easing.md # All easing functions
└── examples/
└── ...
Quick Reference Table
| Goal | File to Read |
|---|---|
| Basic tween/timeline | reference/core-methods.md |
| Scroll animations | plugins/scroll-trigger.md |
| Smooth scrolling | plugins/scroll-smoother.md |
| Text effects | plugins/split-text.md |
| SVG drawing | plugins/draw-svg.md |
| Shape morphing | plugins/morph-svg.md |
| Path animation | plugins/motion-path.md |
| Layout animations | plugins/flip.md |
| Drag & drop | plugins/draggable.md |
| Input handling | plugins/observer.md |
| Physics | plugins/physics.md |
| React | frameworks/react.md |
| Next.js | frameworks/nextjs.md |
| Easing functions | reference/easing.md |
| Utility methods | reference/utilities.md |
Helpful Resources
- Official Docs: https://gsap.com/docs/v3/
- Cheatsheet: https://gsap.com/cheatsheet
- Easing Visualizer: https://gsap.com/docs/v3/Eases/
04 同仓库更多 Skills
frontend-slides
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.
design-dna
Extract, define, and apply design DNA across three dimensions: design system (tokens), design style (qualitative feel), and visual effects (Canvas, WebGL, 3D, particles, shaders, scroll effects, etc.). Use this skill when: (1) a user wants to see the full 3-dimension design structure/schema, (2) a user provides images, screenshots, or URLs of reference designs and wants them analyzed into a structured JSON profile covering all three dimensions, (3) a user has a Design DNA JSON and content and wants a design generated from it, or (4) any combination of these phases. Triggers on "design DNA", "extract design style", "analyze design", "design tokens from reference", "generate design from JSON", "design system from screenshot", "design profile", "style guide JSON", "visual effects analysis", "design with effects", "3d design analysis".
wireframe
Generate JSON wireframe with HTML preview
social-publishing
Schedule and publish social media posts across 13 platforms (X, LinkedIn, Instagram, Facebook Pages, TikTok, Discord, Telegram, YouTube, Reddit, WordPress, Pinterest) via the SocialClaw API. Use when the user wants to publish, schedule, or manage social media content programmatically. Requires SOCIALCLAW_API_KEY.
hermes-tweet
Install and operate Hermes Tweet, a Hermes Agent plugin for X/Twitter research, timeline reading, tweet analysis, and approval-gated private or state-changing operations. Use this skill when installing Hermes Tweet, researching X/Twitter accounts, monitoring launch signals, investigating mentions, auditing giveaways, or preparing gated X operations. Use proactively when a Hermes Agent workflow needs current X/Twitter context. Requires XQUIK_API_KEY for read and action tools.
refactoring-ui
Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions "my UI looks off" (or amateur/unprofessional), "fix the design", "Tailwind styling", "color palette", "visual hierarchy", "design system", "spacing scale", or "component styling". Also trigger when building consistent design tokens, creating dark mode themes, improving data-visualization clarity, or polishing UI details before launch. Covers grayscale-first workflow, constrained design scales, shadows, and component styling. For typeface selection, see web-typography. For usability audits, see ux-heuristics.