Communitygithub.com

assafkip/claude-video-editor

GSAP 動畫參考,專為 HyperFrames 設計。涵蓋 gsap.to()、from()、fromTo()、 easing、stagger、defaults、時間軸(gsap.timeline()、位置參數、標籤、巢狀、播放控制)以及效能(transform、will-change、quickTo)。在 HyperFrames 組合中撰寫 GSAP 動畫時使用。

claude-video-editor 是什麼?

這個技能是為 HyperFrames 組合環境提供的 GSAP(GreenSock Animation Platform)動畫參考指南,目標受眾為開發者與 AI 代理人。它詳細記錄了核心補間方法:gsap.to()、gsap.from()、gsap.fromTo() 與 gsap.set(),並強調使用駝峰式屬性名稱。技能深入說明常用屬性(duration、delay、ease、stagger、repeat、yoyo、回呼函數)以及 transform 別名(x、y、scale、rotation 等),還有 autoAlpha、CSS 變數、方向性旋轉、相對值等進階功能。此外,完整涵蓋時間軸(gsap.timeline)的建立、位置參數、標籤、巢狀時間軸與播放控制。效能最佳化部分包括優先使用 transform 與 opacity、設定 will-change、引入 gsap.quickTo() 處理頻繁更新、以 stagger 取代大量補間,以及正確清理補間。技能最後提供最佳實務與禁止事項列表,並連結至 [references/effects.md] 作為現成特效模式。支援平台為 Claude Code、Cursor 等 AI 代理人環境。

相容平台✓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)。

務必使用 駝峰式 (camelCase) 屬性名稱(例如 backgroundColor、rotationX)。

常用變數 (vars)

  • 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 以避免被覆寫。

Transform 與 CSS

優先使用 GSAP 的 transform 別名 而非原始 transform 字串:

GSAP 屬性等效 CSS
x、y、ztranslateX/Y/Z (px)
xPercent、yPercenttranslateX/Y (%)
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,
});

漸變函數 (Easing)

內建緩動: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,
    });
  },
);

時間軸 (Timelines)

建立時間軸

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()。


效能

優先使用 Transform 與 Opacity

對 x、y、scale、rotation、opacity 做動畫會停留在合成器層。若可使用 transform 達到相同效果,請避免使用 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 取代大量補間

使用 stagger 而非分散的多個補間加上手動延遲。

清理

暫停或結束(kill)不在畫面中的動畫。


參考資料(按需載入)

  • references/effects.md — 即用特效:打字機文字、音訊可視化器。在需要為 HyperFrames 取得現成特效模式時閱讀。

最佳實務

  • 使用駝峰式屬性名稱;優先使用 transform 別名與 autoAlpha。
  • 優先使用時間軸而非以 delay 串連;使用位置參數。
  • 使用 addLabel() 加入標籤以利可讀的序列編排。
  • 將預設值傳入時間軸建構函式。
  • 需要控制播放時,儲存補間/時間軸的回傳值。

禁止事項

  • 當 transform 足以替代時,不要對版面屬性(width/height/top/left)做動畫。
  • 不要在相同 SVG 元素上同時使用 svgOrigin 與 transformOrigin。
  • 當時間軸可以序列化時,不要用 delay 來串連動畫。
  • 不要在 DOM 尚未存在時建立補間。
  • 不要跳過清理動作 — 不再使用時務必清除(kill)補間。

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.

相關技能