跳到正文
cccskills
免费在 GitHub 公开中文介绍

gsap-performance

通过检查GSAP动画的位置与透明度变化、集中安排页面测量和更新、停止无用动画,帮助减轻渲染负担,改善列表、鼠标跟随和滚动效果的卡顿。

原文查看原文说明

Official GSAP skill for performance — prefer transforms, avoid layout thrashing, will-change, batching. Use when optimizing GSAP animations, reducing jank, or when the user asks about animation performance, FPS, or smooth 60fps.

AI 评分90分/ 100查看安装方法

适用场景

  • 减少GSAP动画卡顿
  • 改善大量列表元素的动画
  • 减轻鼠标跟随效果的运行负担
  • 检查滚动效果与动画清理

中文介绍

功能

此技能检查GSAP动画中造成渲染负担的实现,帮助减少卡顿。它建议移动元素时使用x、y,而非left、top,并避免反复计算元素的位置和尺寸。还涉及位置与透明度的变化方式、页面测量和更新的集中安排,以及停止不再需要的动画。针对多个元素依次运动,可使用stagger;针对频繁更新,可使用gsap.quickTo()。

适用场景

适合改善现有代码,例如列表动画运行吃力、鼠标跟随效果不够流畅,或需要梳理滚动效果的性能负担。也可以检查屏幕外动画及ScrollTrigger的清理。

使用示例

  • “减少这段GSAP移动动画的卡顿。”
  • “使用gsap.quickTo()调整这段鼠标跟随逻辑。”
  • “检查屏幕外动画和ScrollTrigger的清理。”

注意事项

适用于使用GSAP的网页实现。应避免给所有元素统一设置will-change或同时运行大量动画,并在性能较低的设备上测试。不保证达到60fps。此技能采用MIT许可证。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好资料明确以GSAP卡顿和渲染负担为优化对象,并列出需检查的实现方式。
步骤具体性步骤、输入输出和示例是否具体
A良好资料提供x、y替代方式、读写分离、quickTo代码示例及停止无用动画的说明。
安全性发送数据、删除文件、执行命令等是否有说明
A良好所述操作限于页面渲染和停止动画,不涉及外部发送或文件删除。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足说明以GSAP和ScrollTrigger为前提,但未提供安装步骤。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月20日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(3)

  • SKILL.md4.6 KB
  • LICENSE1.0 KB
  • SOURCES.md818 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

GSAP Performance

Curated from GreenSock's official GSAP skills: https://github.com/greensock/gsap-skills

When to Use This Skill

Apply when optimizing GSAP animations for smooth 60fps, reducing layout/paint cost, or when the user asks about performance, jank, or best practices for fast animations.

Related skills: Build animations with gsap-core (transforms, autoAlpha) and gsap-timeline; for ScrollTrigger performance see gsap-scrolltrigger.

Prefer Transform and Opacity

Animating transform (x, y, scaleX, scaleY, rotation, rotationX, rotationY, skewX, skewY) and opacity keeps work on the compositor and avoids layout and most paint. Avoid animating layout-heavy properties when a transform can achieve the same effect.

  • ✅ Prefer: x, y, scale, rotation, opacity.
  • ❌ Avoid when possible: width, height, top, left, margin, padding (they trigger layout and can cause jank).

GSAP’s x and y use transforms (translate) by default; use them instead of left/top for movement.

will-change

Use will-change in CSS on elements that will animate. It hints the browser to promote the layer.

will-change: transform;

Batch Reads and Writes

GSAP batches updates internally. When mixing GSAP with direct DOM reads/writes or layout-dependent code, avoid interleaving reads and writes in a way that causes repeated layout thrashing. Prefer doing all reads first, then all writes (or let GSAP handle the writes in one go).

Many Elements (Stagger, Lists)

  • Use stagger instead of many separate tweens with manual delays when the animation is the same; it’s more efficient.
  • For long lists, consider virtualization or animating only visible items; avoid creating hundreds of simultaneous tweens if it causes jank.
  • Reuse timelines where possible; avoid creating new timelines every frame.

Frequently updated properties (e.g. mouse followers)

Prefer gsap.quickTo() for properties that are updated often (e.g. mouse-follower x/y). It reuses a single tween instead of creating new tweens on each update.

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
    yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });

document.querySelector("#container").addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

ScrollTrigger and Performance

  • pin: true promotes the pinned element; pin only what’s needed.
  • scrub with a small value (e.g. scrub: 1) can reduce work during scroll; test on low-end devices.
  • Call ScrollTrigger.refresh() only when layout actually changes (e.g. after content load), not on every resize; debounce when possible.

Reduce Simultaneous Work

  • Pause or kill off-screen or inactive animations when they’re not visible (e.g. when the user navigates away).
  • Avoid animating huge numbers of properties on many elements at once; simplify or sequence if needed.

Best practices

  • ✅ Animate transform and opacity; use will-change in CSS only on elements that animate.
  • ✅ Use stagger instead of many separate tweens with manual delays when the animation is the same.
  • ✅ Use gsap.quickTo() for frequently updated properties (e.g. mouse followers).
  • ✅ Clean up or kill off-screen animations; call ScrollTrigger.refresh() when layout changes, debounced when possible.

Do Not

  • ❌ Animate width/ height/ top/ left for movement when x/ y/ scale can achieve the same look.
  • ❌ Set will-change or force3D on every element “just in case”; use for elements that are actually animating.
  • ❌ Create hundreds of overlapping tweens or ScrollTriggers without testing on low-end devices.
  • ❌ Ignore cleanup; stray tweens and ScrollTriggers keep running and can hurt performance and correctness.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

8-bit-orbit-video-template

免费有简介AI 评分 90分

使用Hyperframes的HTML模板制作复古像素风格的三场景视频,替换标题、标签和配色,同时保留场景转换节奏及可重复的动画时序。

  • 制作像素风格的介绍视频
  • 替换三场景视频中的内容
  • 通过HTML预览场景转换
nexu-io/open-design10.3万2026年10月21日 更新

ad-creative

免费有简介AI 评分 80分

为社交媒体广告和搜索广告撰写标题、说明及正文,并反复调整措辞。可用于准备广告文案备选版本,以及检查现有文案并考虑修改方案。

  • 撰写社交媒体广告标题
  • 准备搜索广告说明
  • 修改广告正文措辞
nexu-io/open-design10.3万2026年10月21日 更新

after-hours-editorial-template

免费有简介AI 评分 80分

以深色背景和衬线字体制作时尚杂志风格的三页动态展示,结合文字逐步显现与章节转场,最终生成内嵌CSS和JavaScript的单个HTML文件。

  • 制作时尚杂志风格的动态介绍
  • 用三页展示简短故事
  • 将现有品牌风格融入深色版面
nexu-io/open-design10.3万2026年10月21日 更新

agent-browser

免费有简介AI 评分 100分

通过浏览器查看页面,执行点击、输入、截图和信息提取。主要用于检查OpenDesign的本地预览,以及核查网页应用的运行情况与质量。

  • 检查OpenDesign本地预览
  • 测试网页应用的点击和输入
  • 截取页面或元素图像
nexu-io/open-design10.3万2026年10月21日 更新

ai-music-album

免费有简介AI 评分 80分

用于AI音乐专辑制作,涵盖概念构思、歌词初稿、曲目排序和导出,适合独立专辑实验或品牌音乐企划;完整制作流程需另行安装上游资源包。

  • 策划独立制作的专辑
  • 围绕专辑主题起草歌词
  • 安排专辑曲目顺序
nexu-io/open-design10.3万2026年10月21日 更新

algorithmic-art

免费有简介AI 评分 80分

使用p5.js,根据计算规则与随机数创作生成艺术。固定随机种子即可重现相同画面,适合制作海报、表现动感的静态图像和艺术构图草案。

  • 根据规则制作海报
  • 创作具有动感的静态图像
  • 试验艺术作品的构图
nexu-io/open-design10.3万2026年10月21日 更新

查看 nexu-io 的全部技能

报告此技能的问题