Communitygithub.com

assafkip/claude-video-editor

GSAP 动画参考,专为 HyperFrames 设计。涵盖 gsap.to()、from()、fromTo()、缓动、交错、默认值、时间线(gsap.timeline()、位置参数、标签、嵌套、播放控制)以及性能优化(变换、will-change、quickTo)。用于在 HyperFrames 合成中编写 GSAP 动画。

claude-video-editor 是什么?

该技能是一份全面的 GSAP 动画参考指南,专门面向使用 HyperFrames 的开发者。它系统性地介绍了核心补间方法(gsap.to、from、fromTo 和 set),并提供了常用的变量配置,如持续时间、延迟、缓动函数和交错效果。技能详细说明了 GSAP 的变换别名(如 x、y、scale、rotation)优于原始 CSS transform 属性的性能优势,同时涵盖了 autoAlpha、CSS 变量和方向性旋转等高级功能。对于复杂动画编排,技能深入讲解了时间线的创建、位置参数的精确控制、标签使用以及时间线嵌套。技能还重点强调了性能优化技巧,包括优先使用 transform 和 opacity 属性、应用 will-change CSS 声明、利用 gsap.quickTo 处理高频更新,以及通过 stagger 替代多个独立补间。此外,技能提供了最佳实践指导,如使用驼峰式属性命名、避免动画化布局属性,以及正确清理不再使用的补间。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/assafkip/claude-video-editor/tree/HEAD/skills/gsap

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

GSAP

核心补间方法

  • gsap.to(targets, vars) — 从当前状态动画到 vars。最常用。
  • gsap.from(targets, vars) — 从 vars 动画到当前状态(入场效果)。
  • gsap.fromTo(targets, fromVars, toVars) — 明确的起始和结束状态。
  • gsap.set(targets, vars) — 立即应用(持续时间为 0)。

始终使用驼峰式属性名称(例如 backgroundColor、rotationX)。

常用变量

  • duration — 秒(默认 0.5)。
  • delay — 开始前的秒数。
  • ease — "power1.out"(默认)、"power3.inOut"、"back.out(1.7)"、"elastic.out(1, 0.3)"、"none"。
  • stagger — 数字 0.1 或对象:{ amount: 0.3, from: "center" }、{ each: 0.1, from: "random" }。
  • overwrite — false(默认)、true 或 "auto"。
  • repeat — 数字或 -1 表示无限循环。yoyo — 与 repeat 配合,交替方向。
  • onComplete、onStart、onUpdate — 回调函数。
  • immediateRender — 对于 from()/fromTo() 默认为 true。如果后续补间针对相同属性和元素,则设置为 false 以避免覆盖。

变换和 CSS

优先使用 GSAP 的变换别名,而不是原始的 transform 字符串:

GSAP 属性等效属性
x、y、ztranslateX/Y/Z (px)
xPercent、yPercenttranslateX/Y in %
scale、scaleX、scaleYscale
rotationrotate (deg)
rotationX、rotationY3D rotate
skewX、skewYskew
transformOrigintransform-origin
  • autoAlpha — 优先于 opacity。为 0 时,同时设置 visibility: hidden。
  • CSS 变量 — "--hue": 180。
  • svgOrigin (仅 SVG) — 全局 SVG 坐标空间原点。不要与 transformOrigin 结合使用。
  • 方向性旋转 — "360_cw"、"-170_short"、"90_ccw"。
  • clearProps — "all" 或逗号分隔;完成后移除内联样式。
  • 相对值 — "+=20"、"-=10"、"*=2"。

基于函数的值

gsap.to(".item", {
  x: (i, target, targets) => i * 50,
  stagger: 0.1,
});

缓动

内置缓动:power1–power4、back、bounce、circ、elastic、expo、sine。每个都有 .in、.out、.inOut。

默认值

gsap.defaults({ duration: 0.6, ease: "power2.out" });

控制补间

const tween = gsap.to(".box", { x: 100 });
tween.pause();
tween.play();
tween.reverse();
tween.kill();
tween.progress(0.5);
tween.time(0.2);

gsap.matchMedia()(响应式 + 无障碍)

仅在媒体查询匹配时运行设置;在不再匹配时自动还原。

let mm = gsap.matchMedia();
mm.add(
  {
    isDesktop: "(min-width: 800px)",
    reduceMotion: "(prefers-reduced-motion: reduce)",
  },
  (context) => {
    const { isDesktop, reduceMotion } = context.conditions;
    gsap.to(".box", {
      rotation: isDesktop ? 360 : 180,
      duration: reduceMotion ? 0 : 2,
    });
  },
);

时间线

创建时间线

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

位置参数

第三个参数控制放置位置:

  • 绝对:1 — 在 1 秒处
  • 相对:"+=0.5" — 结束后;"-=0.2" — 结束前
  • 标签:"intro"、"intro+=0.3"
  • 对齐:"<" — 与上一个同时开始;">" — 上一个结束后开始;"<0.2" — 上一个开始后 0.2 秒开始
tl.to(".a", { x: 100 }, 0);
tl.to(".b", { y: 50 }, "<"); // 与 .a 同时开始
tl.to(".c", { opacity: 0 }, "<0.2"); // .b 开始后 0.2 秒开始

标签

tl.addLabel("intro", 0);
tl.to(".a", { x: 100 }, "intro");
tl.addLabel("outro", "+=0.5");
tl.play("outro");
tl.tweenFromTo("intro", "outro");

时间线选项

  • paused: true — 创建时暂停;调用 .play() 开始。
  • repeat、yoyo — 应用于整个时间线。
  • defaults — 变量合并到每个子补间中。

嵌套时间线

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

播放控制

tl.play()、tl.pause()、tl.reverse()、tl.restart()、tl.time(2)、tl.progress(0.5)、tl.kill()。


性能

优先使用变换和不透明度

动画 x、y、scale、rotation、opacity 保持在合成器上。当变换可以达到相同效果时,避免使用 width、height、top、left。

will-change

will-change: transform;

仅在实际动画的元素上使用。

gsap.quickTo() 用于频繁更新

let xTo = gsap.quickTo("#id", "x", { duration: 0.4, ease: "power3" }),
  yTo = gsap.quickTo("#id", "y", { duration: 0.4, ease: "power3" });
container.addEventListener("mousemove", (e) => {
  xTo(e.pageX);
  yTo(e.pageY);
});

交错优于多个补间

使用 stagger 而不是多个带有手动延迟的单独补间。

清理

暂停或停止屏幕外动画。


参考资料(按需加载)

  • references/effects.md — 即用效果:打字机文本、音频可视化器。当需要 HyperFrames 的现成效果模式时阅读。

最佳实践

  • 使用驼峰式属性名称;优先使用变换别名和 autoAlpha。
  • 优先使用时间线而不是通过 delay 链式调用;使用位置参数。
  • 使用 addLabel() 添加标签以实现可读的序列。
  • 将默认值传入时间线构造函数。
  • 在控制播放时存储补间/时间线的返回值。

禁止事项

  • 在变换足够的情况下动画化布局属性(width/height/top/left)。
  • 在同一个 SVG 元素上同时使用 svgOrigin 和 transformOrigin。
  • 在时间线可以序列化动画时,使用 delay 链式调用动画。
  • 在 DOM 存在之前创建补间。
  • 跳过清理——在不再需要时务必停止补间。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

assafkip/claude-video-editor

Build videos from stills when there is nothing to cut — narration first (ElevenLabs v3 with audio tags), then still keyframes from ANY source (AI image tools, screenshots, photos, HyperFrames-rendered HTML), animated deterministically with the animate-stills recipe (HyperFrames camera moves + GSAP atmosphere). Use when the user wants an explainer, documentary-style video, or any video built from generated or collected visuals instead of recorded footage.

assafkip/claude-video-editor

HyperFrames CLI tool — hyperframes init, lint, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting or validating compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

assafkip/claude-video-editor

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

assafkip/claude-video-editor

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

assafkip/claude-video-editor

Beginner-friendly end-to-end video creator for HyperFrames. Use when the user says "make a video", "create a video", "new video", "build a video", "video from scratch", "I want to make a video", "help me create a video", or when someone who's never used HyperFrames before arrives with a concept, script, or rough idea and wants a finished MP4. Interviews the user in one pass, then builds the full video with mandatory preview and visual-verification gates.

assafkip/claude-video-editor

Build and iterate short-form vertical (9:16) videos in Hyperframes — TikTok/Reels/Shorts style. Use when Nate says "short-form video", "vertical video", "TikTok/Reels/Shorts", "make a short", "talking-head + motion graphics", or when the target is a 1080x1920 composition with face video + synced scene overlays + karaoke captions. Encodes the full May Shorts 19 playbook: face-mode choreography, audio-synced scene timing, karaoke captions, and the 10-rule quality checklist.

assafkip/claude-video-editor

Edit any video by conversation — the orchestrator for the bundled video pipeline. Use when the user wants to edit, cut, caption, grade, or add motion graphics to footage; drops a folder of clips and says "edit this"; or asks to make a promo/teaser/tutorial/short. Routes to video-use (the cut engine) and HyperFrames (motion-graphics overlays), with a motion-craft library for taste.

assafkip/claude-video-editor

Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric/mathematical content.

assafkip/claude-video-editor

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

相关技能