Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计通过

gsapGSAP 动画开发

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,224

周安装

50

GitHub Stars

1

下载量

396
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gsap(GSAP 动画开发)
来源仓库:https://github.com/noklip-io/agent-skills
仓库路径:skills/gsap
安装命令:
npx skills add https://github.com/noklip-io/agent-skills --skill gsap
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/noklip-io/agent-skills --skill gsap

简介

gsap 用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 支持 GSAP 动画库的使用与集成。
  • 安装命令:npx skills add https://github.com/noklip-io/agent-skills --skill gsap。
  • 使用时需结合项目现有设计系统,避免生成孤立片段,建议配合本地预览验证效果。

SKILL.md

GSAP Best Practices

Professional-grade JavaScript animation library for the modern web. Provides high-performance tweening with powerful sequencing, scroll-based animations, and extensive plugin ecosystem.

Installation

# Core library
npm install gsap

# React hook
npm install @gsap/react

# Register plugins (do once at app entry)
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
gsap.registerPlugin(ScrollTrigger)

Quick Start

import gsap from 'gsap'

// Basic tween
gsap.to('.box', { x: 200, duration: 1 })

// From animation
gsap.from('.box', { opacity: 0, y: 50, duration: 0.5 })

// Timeline sequence
const tl = gsap.timeline()
tl.to('.box1', { x: 100 })
  .to('.box2', { x: 100 }, '-=0.5')  // overlap by 0.5s
  .to('.box3', { x: 100 }, '<')       // same start as previous

Core Concepts

ConceptDescription
TweenSingle animation that changes properties over time
TimelineContainer for sequencing tweens with precise control
EaseControls animation velocity curve (default: power1.out)
ScrollTriggerLinks animations to scroll position
PluginExtends GSAP with specialized capabilities

Reference Index

ReferenceUse When
references/00-cheatsheet.mdQuick reference, common operations at a glance
references/01-core.mdBasic tweens, special properties, callbacks, quickTo, ticker
references/02-easing.mdEasing functions, custom eases
references/03-timeline.mdSequencing, positioning, labels, nesting
references/04-stagger.mdStaggered animations, grid distributions
references/05-utilities.mdHelper functions (toArray, clamp, interpolate)
references/06-scrolltrigger.mdScroll-based animations, pin, scrub, snap
references/07-scrollsmoother.mdSmooth scrolling, parallax effects
references/08-splittext.mdText splitting and animation
references/09-svg-plugins.mdDrawSVG, MorphSVG, MotionPath
references/10-flip.mdLayout animations (FLIP technique)
references/11-react.mduseGSAP hook, cleanup, React patterns
references/12-observer-draggable.mdGesture detection, draggable elements
references/13-text-plugins.mdTextPlugin, ScrambleTextPlugin

Common Patterns

Fade In on Load

gsap.from('.hero', {
  opacity: 0,
  y: 30,
  duration: 1,
  ease: 'power2.out'
})

Staggered List Animation

gsap.from('.list-item', {
  opacity: 0,
  y: 20,
  stagger: 0.1,
  duration: 0.5
})

Scroll-Triggered Animation

gsap.registerPlugin(ScrollTrigger)

gsap.to('.box', {
  x: 500,
  scrollTrigger: {
    trigger: '.box',
    start: 'top 80%',
    end: 'top 20%',
    scrub: true
  }
})

Timeline with Controls

const tl = gsap.timeline({ paused: true })
tl.to('.modal', { opacity: 1, scale: 1, duration: 0.3 })
  .from('.modal-content', { y: 20, opacity: 0 }, '-=0.1')

// Control playback
tl.play()
tl.reverse()
tl.progress(0.5)

Critical Mistakes to Avoid

1. Missing Plugin Registration

// ❌ Plugin won't work
import { ScrollTrigger } from 'gsap/ScrollTrigger'
gsap.to('.box', { scrollTrigger: { ... } })

// ✅ Register plugins first
gsap.registerPlugin(ScrollTrigger)
gsap.to('.box', { scrollTrigger: { ... } })

2. React Cleanup Issues

// ❌ Memory leaks, zombie animations
useEffect(() => {
  gsap.to('.box', { x: 100 })
}, [])

// ✅ Use useGSAP hook for automatic cleanup
import { useGSAP } from '@gsap/react'
useGSAP(() => {
  gsap.to('.box', { x: 100 })
}, { scope: containerRef })

3. Conflicting Tweens

// ❌ Two tweens fighting for same property
gsap.to('.box', { x: 100, duration: 2 })
gsap.to('.box', { x: 200, duration: 1 })

// ✅ Use overwrite or kill previous
gsap.to('.box', { x: 100, duration: 2, overwrite: true })
// or
gsap.killTweensOf('.box')
gsap.to('.box', { x: 200, duration: 1 })

4. ScrollTrigger Not Refreshing

// ❌ Layout changes but ScrollTrigger uses old positions
dynamicallyAddContent()

// ✅ Refresh after DOM/layout changes
dynamicallyAddContent()
ScrollTrigger.refresh()

5. Animating Non-Existent Elements

// ❌ Element not in DOM yet
gsap.to('.dynamic-element', { x: 100 })

// ✅ Wait for element or use immediateRender: false
gsap.to('.dynamic-element', {
  x: 100,
  immediateRender: false,
  scrollTrigger: { ... }
})

6. Wrong from() Behavior

// ❌ from() renders immediately, causing flash
gsap.from('.box', { opacity: 0 })

// ✅ Set initial state in CSS or use fromTo
// CSS: .box { opacity: 0; }
gsap.to('.box', { opacity: 1 })

// or use fromTo for explicit control
gsap.fromTo('.box', { opacity: 0 }, { opacity: 1 })

7. Forgetting Selector Scope

// ❌ Affects ALL .box elements on page
gsap.to('.box', { x: 100 })

// ✅ Scope to container
gsap.to('.box', { x: 100 }, { scope: containerRef })
// or use gsap.utils.selector
const q = gsap.utils.selector(container)
gsap.to(q('.box'), { x: 100 })

Quick Reference

TaskSolution
Animate to valuesgsap.to(target, {props})
Animate from valuesgsap.from(target, {props})
Animate both directionsgsap.fromTo(target, {from}, {to})
Set instantlygsap.set(target, {props})
Create timelinegsap.timeline({options})
Kill all tweensgsap.killTweensOf(target)
Global defaultsgsap.defaults({ease, duration})
Register plugingsap.registerPlugin(Plugin)
Get by IDgsap.getById('myTween')
Match mediagsap.matchMedia()

Plugin Availability

PluginLicenseDescription
ScrollTriggerFreeScroll-based animations
ObserverFreeGesture/scroll detection
DraggableFreeDrag interactions
FlipFreeLayout animations
TextPluginFreeText content animation
ScrollSmootherClubSmooth scrolling
SplitTextClubText splitting
DrawSVGClubSVG stroke animation
MorphSVGClubSVG morphing
MotionPathClubPath-based motion
ScrollToFreeScroll to position

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

29.12%
按下载量换算115

OpenCode

21.41%
按下载量换算85

Claude Code

16.32%
按下载量换算65

Gemini CLI

12.05%
按下载量换算48

Codex

8.3%
按下载量换算33

Cursor

3.78%
按下载量换算15

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills