技能 gsap
🎬

gsap

低风险 ⚡ 包含脚本📁 文件系统访问⚙️ 外部命令

创建专业级 GSAP 视频动画

为视频合成编写 GSAP 动画需要精确的时序控制和确定性执行。本技能提供全面的 GSAP 文档和可直接使用的 HyperFrames 特效,让你无需翻阅多个资源即可创建流畅、专业的动画。

支持: Claude Codex Code(CC)
🥉 73 青铜
1

下载技能 ZIP

2

在 Claude 中上传

前往 设置 → 功能 → 技能 → 上传技能

3

开启并开始使用

测试它

正在使用“gsap”。 Animate .card elements with a stagger effect, 0.1s delay between each card, sliding in from the left

预期结果:

gsap.from('.card', {
x: -50,
opacity: 0,
stagger: 0.1,
duration: 0.5,
ease: 'power2.out'
});

正在使用“gsap”。 Build a timeline where .logo fades in first, then .headline slides up, then .subtitle fades in after headline completes

预期结果:

const tl = gsap.timeline();
tl.to('.logo', { opacity: 1, duration: 0.4 })
.to('.headline', { y: 0, opacity: 1, duration: 0.5 }, '<')
.to('.subtitle', { opacity: 1, duration: 0.4 }, '+=0.2');

正在使用“gsap”。 Type 'Welcome' at 12 characters per second with cursor '|' that blinks between solid and blinking states

预期结果:

const text = 'Welcome';
const cps = 12;
tl.call(() => cursor.classList.replace('cursor-blink', 'cursor-solid'), [], t);
tl.to('#typed', { text: { value: text }, duration: text.length / cps, ease: 'none' }, t);
tl.call(() => cursor.classList.replace('cursor-solid', 'cursor-blink'), [], t + text.length / cps);

安全审计

低风险
v1 • 4/27/2026

Static analysis flagged 171 potential issues, but evaluation determined all critical and high findings are false positives. The scanner misidentified HTML script tags as shell commands, FFT signal processing as weak cryptography, and generic variable names as credential access patterns. The Python audio extraction script uses subprocess to run ffmpeg for legitimate audio processing. No malicious behavior or user input injection vectors detected.

3
已扫描文件
699
分析行数
8
发现项
1
审计总数

高风险问题 (2)

Static Analysis False Positive: Weak Cryptographic Algorithm
The static scanner flagged np.fft.rfft() and related operations as 'weak cryptographic algorithm'. This is incorrect - these are standard Fast Fourier Transform operations used for audio signal processing, not cryptography. FFT decomposes audio signals into frequency components for visualization.
Static Analysis False Positive: Credential Access Patterns
The scanner flagged variable names like 'samples', 'SAMPLE_RATE', and file references as 'Windows SAM database' access. This is pattern-matching noise - the skill has no access to Windows credentials. Variables are standard Python naming for audio sample data.
中风险问题 (1)
Static Analysis False Positive: Ruby/Shell Command Execution
The static scanner flagged 139 instances of 'Ruby/shell backtick execution' in references/effects.md and SKILL.md. These are false positives - the scanner detected HTML script tags like '<script src="https://...">' and markdown code snippets as shell commands. These are legitimate CDN URL references and documentation code examples.
低风险问题 (2)
Python subprocess.run for FFmpeg
The extract-audio-data.py script uses subprocess.run() to invoke ffmpeg for audio decoding. This is a standard audio processing pattern with no injection risk - the command arguments are hardcoded except for the input path from command-line arguments.
XMLHttpRequest Usage for Audio Data Loading
The audio visualizer effect uses synchronous XMLHttpRequest to load audio data files. This is documented as intentional for HyperFrames deterministic timeline construction. No user-controlled input or security vulnerability.

风险因素

审计者: claude

质量评分

64
架构
100
可维护性
87
内容
50
社区
61
安全
91
规范符合性

你能构建什么

为视频叠加层添加入场动画

为视频合成中的文字叠加层和 UI 元素创建淡入、滑入或缩放入场动画。

构建音频响应式可视化器

创建基于画布的音频可视化器,能够响应视频背景中的音乐或语音。

编排复杂的多步骤动画

使用 GSAP 时间线、标签和位置参数协调多个动画,实现精确的时序控制。

试试这些提示

基础补间动画
Use GSAP to animate #hero element fading in and sliding up 100px. Duration 0.6s with power2.out easing.
时间线序列
Create a GSAP timeline that: 1) fades in .title, 2) fades in .subtitle 0.2s after, 3) scales in .button at 0.5s. Use position parameters, not delay.
打字机效果
Create a typewriter animation for #message that types at 10 characters per second with a blinking cursor. Cursor should blink when idle.
音频可视化器帧
Render audio frame [FRAME] with bars using AUDIO_DATA.frames[0].bands array. Each band maps to a canvas rectangle. Bass drives scale, treble drives opacity.

最佳实践

  • 使用 transform 属性(x、y、scale、rotation)而非布局属性,以启用 GPU 加速
  • 将默认值传递给时间线构造函数,而非通过 delay 链式调用,以提高可读性
  • 需要通过编程方式控制回放时,存储补间和时间线的返回值

避免

  • 当使用 transform 可以达到相同效果时,不要动画化 width、height、top 或 left
  • 当时间线配合位置参数可以更好地排序序列时,不要使用 delay 链式调用补间
  • 不要为尚未存在于 DOM 中的元素创建补间

常见问题

什么是 GSAP?
GSAP(GreenSock Animation Platform)是一个用于高性能动画的 JavaScript 库。它提供了 CSS 动画无法匹配的精确时序、缓动和排序控制。
如何创建时间线?
使用 gsap.timeline() 创建时间线,然后使用 .to() 或 .from() 链式调用补间。补间默认按顺序添加,或使用位置参数(如 '<' 或 '+=0.5')来控制重叠。
什么是位置参数?
补间中的第三个参数控制其在时间线中的放置位置。使用数字表示绝对时间,'+=0.5' 表示相对于结束时间的相对时间,'<' 表示与前一个补间同时开始,或使用标签名称。
打字机效果是如何工作的?
GSAP TextPlugin 逐字符动画化文本内容。根据文本长度除以每秒字符数设置持续时间。通过类切换单独管理光标状态。
为什么使用同步 XHR 获取音频数据?
HyperFrames 在页面加载后同步读取 window.__timelines。异步数据加载意味着捕获开始时时间线尚未就绪。这是为实现确定性视频渲染而特意设计的。
extract-audio-data.py 支持哪些音频格式?
脚本使用 ffmpeg 进行解码,因此支持 ffmpeg 处理的所有音频格式:MP3、WAV、AAC、OGG,以及包含音频的视频文件(MP4、WebM、MOV)。

开发者详情

文件结构