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

gsap-timeline

使用GSAP时间轴编排多个动画的先后顺序与重叠关系,指定开始时间、为片段添加标签、嵌套组合较小的时间轴,并控制播放、暂停、倒放及跳转。

原文查看原文说明

Official GSAP skill for timelines — gsap.timeline(), position parameter, nesting, playback. Use when sequencing animations, choreographing keyframes, or when the user asks about animation sequencing, timelines, or animation order (in GSAP or when recommending a library that supports timelines).

实测评分 未实测

查看安装方法

适用场景

  • 让多个元素依次运动
  • 精细调整动画重叠时间
  • 用标签整理动画片段
  • 组合较小的动画时间轴
  • 添加播放、暂停和倒放控制

中文介绍

功能

将多个GSAP动画放入同一条时间轴,调整先后顺序和重叠关系。通过gsap.timeline()及其位置参数,按秒数或相对前一个动画的位置安排动作。还支持为片段添加标签、统一设置时长和缓动,以及将较小的时间轴嵌套组合起来。除播放、暂停和倒放外,也支持跳转到指定时间。

适用场景

适合让文字、图片和图形依次运动,或让多个动作同时开始。如果需要按场景整理较长的动画,并在之后调整节奏,也可以使用。

使用示例

  • “创建一条时间轴,让标题、图片和按钮依次出现。”
  • “让第二个动作在前一个动作开始后0.2秒启动。”
  • “添加intro和outro标签,并播放两者之间的片段。”

注意事项

适用于使用GSAP的代码。整条时间轴的时长由内部动画决定。搭配ScrollTrigger时,应将其设置在最上层时间轴等顶层动画上,而非时间轴内部的单个动画上。单个动作、滚动联动和React的详细用法另有相关技能介绍。

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

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好示例仅涉及动画控制,没有外部发送或文件操作。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足需要使用GSAP,但未提供安装或加载步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月23日 评估。仅供参考,安装前请同时查看原文。

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

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

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

包含的文件(1)

  • SKILL.md4.3 KB

SKILL.md(原文)

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

GSAP Timeline

When to Use This Skill

Apply when building multi-step animations, coordinating several tweens in sequence or parallel, or when the user asks about timelines, sequencing, or keyframe-style animation in GSAP.

Related skills: For single tweens and eases use gsap-core; for scroll-driven timelines use gsap-scrolltrigger; for React use gsap-react.

Creating a Timeline

const tl = gsap.timeline();
tl.to(".a", { x: 100, duration: 1 })
  .to(".b", { y: 50, duration: 0.5 })
  .to(".c", { opacity: 0, duration: 0.3 });

By default, tweens are appended one after another. Use the position parameter to place tweens at specific times or relative to other tweens.

Position Parameter

Third argument (or position property in vars) controls placement:

  • Absolute: 1 — start at 1 second.
  • Relative (default): "+=0.5" — 0.5s after end; "-=0.2" — 0.2s before end.
  • Label: "labelName" — at that label; "labelName+=0.3" — 0.3s after label.
  • Placement: "<" — start when recently-added animation starts; ">" — start when recently-added animation ends (default); "<0.2" — 0.2s after recently-added animation start.

Examples:

tl.to(".a", { x: 100 }, 0);           // at 0
tl.to(".b", { y: 50 }, "+=0.5");      // 0.5s after last end
tl.to(".c", { opacity: 0 }, "<");     // same start as previous
tl.to(".d", { scale: 2 }, "<0.2");    // 0.2s after previous start

Timeline Defaults

Pass defaults into the timeline so all child tweens inherit:

const tl = gsap.timeline({ defaults: { duration: 0.5, ease: "power2.out" } });
tl.to(".a", { x: 100 }).to(".b", { y: 50 }); // both use 0.5s and power2.out

Timeline Options (constructor)

  • paused: true — create paused; call .play() to start.
  • repeat, yoyo — same as tweens; apply to whole timeline.
  • onComplete, onStart, onUpdate — timeline-level callbacks.
  • defaults — vars merged into every child tween.

Labels

Add and use labels for readable, maintainable sequencing:

tl.addLabel("intro", 0);
tl.to(".a", { x: 100 }, "intro");
tl.addLabel("outro", "+=0.5");
tl.to(".b", { opacity: 0 }, "outro");
tl.play("outro");  // start from "outro"
tl.tweenFromTo("intro", "outro"); // pauses the timeline and returns a new Tween that animates the timeline's playhead from intro to outro with no ease.

Nesting Timelines

Timelines can contain other timelines.

const master = gsap.timeline();
const child = gsap.timeline();
child.to(".a", { x: 100 }).to(".b", { y: 50 });
master.add(child, 0);
master.to(".c", { opacity: 0 }, "+=0.2");

Controlling Playback

  • tl.play() / tl.pause()
  • tl.reverse() / tl.progress(1) then tl.reverse()
  • tl.restart() — from start.
  • tl.time(2) — seek to 2 seconds.
  • tl.progress(0.5) — seek to 50%.
  • tl.kill() — kill timeline and (by default) its children.

Official GSAP Best practices

  • ✅ Prefer timelines for sequencing
  • ✅ Use the position parameter (third argument) to place tweens at specific times or relative to labels.
  • ✅ Add labels with addLabel() for readable, maintainable sequencing.
  • ✅ Pass defaults into the timeline constructor so child tweens inherit duration, ease, etc.
  • ✅ Put ScrollTrigger on the timeline (or top-level tween), not on tweens inside a timeline.

Do Not

  • ❌ Chain animations with delay when a timeline can sequence them; prefer gsap.timeline() and the position parameter for multi-step animation.
  • ❌ Forget to pass defaults (e.g. defaults: { duration: 0.5, ease: "power2.out" }) when many child tweens share the same duration or ease.
  • ❌ Forget that duration on the timeline constructor is not the same as tween duration; timeline “duration” is determined by its children.
  • ❌ Nest animations that contain a ScrollTrigger; ScrollTriggers should only be on top-level Tweens/Timelines.

评价

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

评论

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

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

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

0 / 1000 字

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

同一仓库的技能

3d-asset-generation

免费有简介

从文字或图像生成3D模型,并与目录素材搭配使用。在Blender中检查形状、材质、大小和接地情况,记录生成条件、来源及费用,再将素材加入场景。

  • 根据文字生成独特的3D道具
  • 将概念图中的物体转为3D模型
  • 用目录中的植被和岩石填充背景
calesthio/OpenMontage7.1万2026年10月17日 更新

acestep

免费有简介

使用ACE-Step 1.5生成视频背景音乐和带歌词的歌曲,可指定曲风、时长、速度与调性,也支持改编参考音频,以及从混合音频中分离人声或乐器。

  • 制作适合视频场景的背景音乐
  • 制作带歌词的短广告曲
  • 将参考音频改编为爵士风格
calesthio/OpenMontage7.1万2026年10月17日 更新

agents

免费有简介

使用ElevenLabs创建语音对话助手或角色,配置声音、应答规则、语言模型及外部工具,支持嵌入网站,并通过Twilio集成设置电话外呼。

  • 创建回答咨询的语音机器人
  • 在网站中嵌入语音引导
  • 制作可对话的语音角色原型
calesthio/OpenMontage7.1万2026年10月17日 更新

ai-video-gen

免费有简介

根据文字描述或参考图片生成AI视频,并按用途和费用选择生成服务。支持设置画面比例、查看生成进度,以及通过Gemini Omni对话修改现有视频。

  • 将文字描述的场景制作成视频
  • 为商品照片添加动态效果
  • 制作社交媒体竖屏视频
calesthio/OpenMontage7.1万2026年10月17日 更新

ai-video-gen

免费有简介

根据文字或参考图像生成AI视频,并按用途、可用服务和预算选择模型。可制作社交平台竖屏短片、让商品照片动起来,也可通过对话编辑已有片段。

  • 制作社交平台竖屏短片
  • 为商品照片添加动态效果
  • 按预算和风格选择生成服务
calesthio/OpenMontage7.1万2026年10月17日 更新

atlas-cloud

免费有简介

通过Atlas Cloud使用多种模型生成和编辑图像与视频,只需一个API密钥,即可保存生成素材,以及所用模型、提交设置和预估费用等记录。

  • 通过同一服务生成图像和视频
  • 利用参考素材编辑商品图
  • 参考图像、视频和音频生成视频
calesthio/OpenMontage7.1万2026年10月17日 更新

查看 calesthio 的全部技能

报告此技能的问题