Communitygithub.com

動畫語彙庫 / motion-animate

專業動畫語法與時序規範,從文字彈出模糊淡入、序列錯開、持續運鏡到物體進場,附 Remotion 與 HyperFrames (GSAP) 實作程式碼。解決卡頓、跳動、生硬、過快、過於均勻等常見動畫問題。

motion-animate 是什麼?

此技能提供一套精密的動畫設計語彙與工程實作指南,專門用於提升影片動畫的「高級感」與「作者感」。它明確定義了四條核心法則:零線性過渡、零同時進場、攝影機永不靜止、時序不重複。技能核心包含詳盡的時序表(字詞、圖示、面板、英雄物件、攝影機等),並對每個元素指定精準的持續時間、錯開時間與緩動曲線,例如文字採用「彈出模糊淡入」、圖示採用「回彈比例放大」等。 技能提供兩個實作附錄:Appendix A 為 Remotion(幀為基礎)的完整程式碼,包含毫秒轉換 helper、緩動對照表、文字動畫元件、攝影機推位控制器、卡片錯開堆疊與退場邏輯;Appendix B 為 HyperFrames / GSAP 的配方,強調 HTML + GSAP 組合的確定性(no Math.random()、no Date.now()),並嚴格規定「clip 規則」(框架控制 display 與 transform,使用者只操作子層)。 適用平台為 Remotion 與 HyperFrames(headless 瀏覽器渲染),支援所有主流 AI 代理工具(Claude Code、Cursor、Codex)。使用場景包含:設計幀動畫、修復「感覺很僵」、「跳動感太強」、「晃動」、「太快」、「太均勻」等問題,或編寫任何與影片動畫相關的 timing/easing 程式碼。 此技能同時強調「禁止」清單,包括線性緩動、過度回彈、同時進場、均勻節奏、無限循環、隨機函數、不受框架控制的包裝層等,確保輸出品質可預測且專業。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/blixvip/skills/tree/HEAD/motion-animate

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

motion-animate

設計決定一個幀是否好。動畫決定它是否看起來昂貴。 相同的構圖如果用線性緩動與同時進場,就會被讀為隨機生成的;而套用下列語彙,則會被讀為經手創作的。

引擎配方:附錄 A、附錄 B。

四大法則

  1. 沒有線性。 每個屬性都應該有緩動。線性運動在物理世界中不存在,眼睛能立刻察覺。
  2. 沒有同時進場。 元素以 60–120 毫秒間隔有順序地進場。同時進場是最明顯的生成痕跡。
  3. 攝影機從未完全靜止。 每個場景都有一個緩慢的連續推鏡或漂移。靜止的幀讀起來像幻燈片。
  4. 沒有機械式節奏。 要變化持續時間與剪輯間隔。每拍都 1 秒的均勻節奏,無論單拍多好,都感覺像自動化。

時序表

數值以 30fps 為基準;60fps 請等比縮放。時間單位為毫秒。

元素持續時間錯開時間緩動曲線
文字行中的字詞400–55060–90out-expo / power3.out
文字行(單一單位)500–650120–180out-cubic / power2.out
圖示 / 小 UI 元素350–45080–120out-back(回彈不超過 1.06)
面板 / 卡片550–700140–200out-quint / power4.out
Hero 物件縮放進場700–900—out-expo
Hero 物件滑入進場650–850—out-quint
線條 / 筆觸描繪600–1000—in-out-cubic
攝影機推位(每場景)整個場景長度—out-sine,若非常慢則接近線性
退場(任何元素)250–35040–60in-cubic

退場總是比進場快,大約快一半。對稱的退場動畫會感覺遲緩。

核心動作

文字 — 逐字彈出模糊淡入

招牌動作。每個屬性同時動畫,逐字,錯開進場。

y:       +18px → 0
blur:    12px  → 0
opacity: 0     → 1
ease:    out-expo,持續時間 480ms,錯開 70ms

可選加 scale: 0.96 → 1。不要加旋轉。不要回彈。

對於長句,按字詞錯開,不要按字元 — 字元錯開會像打字機噱頭且耗時過長。字元錯開保留給單個短的重點字。

重點字

使用相同動畫,但 比其鄰近字詞延遲 120–200ms,並多加一個屬性 — 顏色變化、縮放到 1.04,或在字後掃入一個高亮條。它應該最後一個著陸且著陸方式不同。

圖示和 UI

彈出淡入:scale 0.7 → 1,opacity 0 → 1,out-back,回彈上限 1.06。超過 1.1 就會顯得太廉價。

順序規則:先進入錨點元素,然後是其依賴項。卡片先進,然後是它的圖示,然後是它的標籤。絕不反過來,也絕不一起進。

面板 / 卡片 / 玻璃效果

y: +40 → 0,opacity 0 → 1,out-quint,600ms,堆疊時錯開 160ms。再加一個掃光高亮,在面板著陸後 150ms 滑過面板 — 面板到達,然後被光照到。

Hero 物件

兩種選擇,按原型選擇:

  • 縮放進場:scale 1.25 → 1.00 加 rotate 3° → 0°,out-expo,800ms。感覺像它落定到位。
  • 滑入進場:從畫框外滑入,帶 2° 傾斜後歸零,out-quint,750ms。感覺像被送達。

投影和裁切紋理必須跟隨 hero 物件,所以它們要和 hero 綁定。未綁定的投影獨立滑動是嚴重的錯誤。

筆觸 / 線條描繪

將路徑長度從 0 動畫到 100%,in-out-cubic,600–1000ms。進場和退場都要緩動 — 從全速開始的描繪會很機械。用於將標籤連接到主體、為重點字加底線,或描繪圖表。

攝影機

每個場景下,選擇一種:

  • 推近:scale 1.00 → 1.08 在整個節拍期間,out-sine。
  • 拉遠:scale 1.12 → 1.00,開始較快,然後穩定。
  • 漂移:x 或 y 平移 2–4%,在整個節拍期間完成。

防抖契約:

  • 動畫一個包裝元素,絕不動畫控制佈局或裁剪的元素。
  • 只使用 transform — 絕不使用 top/left/width/height。
  • 將移動圖層縮放到超過畫框約 6%,確保邊緣永遠不會暴露。
  • 設定 will-change: transform 並強制 GPU 合成。
  • 保持總位移小。大的攝影機移動會放大每個捨入誤差。

場景間過渡

  • 硬切搭配音效衝擊 — 預設。設計幀之間的交叉淡化會模糊兩者。
  • 透過縮放過渡 — 一個元素縮放至充滿畫面,下一個場景在其中顯現。
  • 透過形狀擦拭 — 一個圓形或面板縮放超過畫框邊緣,帶入下一個場景。

不要在兩個設計構圖之間交叉淡化。不要使用預設過渡效果。

禁止

  • 任何可見物體使用線性緩動。
  • 回彈超過 1.1(例外:有意為之的趣味 SaaS/產品風格,且要一致使用)。
  • 所有元素在同一幀進場。
  • 整個剪輯中節拍長度均勻。
  • repeat: -1 或任何無限循環 — 渲染是幀採樣的,必須是確定性的。
  • Math.random(),Date.now() 或網路請求在構圖內部。相同輸入必須每次都產生相同幀。
  • 在框架已經控制的包裝器上套用動畫(見附錄 B §clip 規則)。

自我檢查

以 0.25 倍速播放渲染。問:

  • 有沒有東西突然開始或停止?→ 缺少緩動。
  • 所有東西一起著陸?→ 缺少錯開。
  • 幀是否曾完全靜止?→ 缺少攝影機。
  • 連續的節拍聽起來像鼓點?→ 持續時間太過均勻。
  • 移動圖層的邊緣是否曾暴露?→ 未足夠放大。

附錄 A — Remotion 配方

基於幀,本質上確定性。所有時序從 useCurrentFrame() 推導。

輔助函數:時間以毫秒為單位,而非幀

以幀為單位編寫會將 fps 寫死。進行轉換。

import {useVideoConfig, useCurrentFrame, interpolate, Easing} from 'remotion';

const useMs = () => {
  const {fps} = useVideoConfig();
  return (ms: number) => (ms / 1000) * fps;
};

緩動對照表

時序表中的名稱,以 Remotion 術語表示:

Easing.out(Easing.exp)                    // out-expo
Easing.out(Easing.cubic)                  // out-cubic
Easing.out(Easing.quad)                   // out-quad
Easing.out(Easing.poly(4))                // out-quint 近似
Easing.inOut(Easing.cubic)                // in-out-cubic
Easing.out(Easing.sin)                    // out-sine
Easing.in(Easing.cubic)                   // in-cubic  (退場)
Easing.bezier(0.16, 1, 0.3, 1)            // 主力 — 近似 out-expo

對於回彈,優先使用 spring 而不是 Easing.back — 更容易保持微妙。

import {spring} from 'remotion';
const s = spring({frame, fps, config: {damping: 200, stiffness: 120, mass: 0.6}});
// damping 200 = 無可見回彈。降至 ~14 可產生輕微穩定效果。

文字 — 逐字彈出模糊淡入

const Words: React.FC<{text: string; delay?: number}> = ({text, delay = 0}) => {
  const frame = useCurrentFrame();
  const ms = useMs();
  const STAGGER = ms(70);
  const DUR = ms(480);

  return (
    <span style={{display: 'inline-flex', flexWrap: 'wrap', gap: '0.28em'}}>
      {text.split(' ').map((word, i) => {
        const local = frame - ms(delay) - i * STAGGER;
        const p = interpolate(local, [0, DUR], [0, 1], {
          extrapolateLeft: 'clamp',
          extrapolateRight: 'clamp',
          easing: Easing.bezier(0.16, 1, 0.3, 1),
        });
        return (
          <span
            key={i}
            style={{
              display: 'inline-block',
              opacity: p,
              filter: `blur(${(1 - p) * 12}px)`,
              transform: `translateY(${(1 - p) * 18}px)`,
              willChange: 'transform, filter, opacity',
            }}
          >
            {word}
          </span>
        );
      })}
    </span>
  );
};

重點字是相同的元件,但 delay 設定為 120–200ms 之後,再加上自己的顏色和 scale(1.04)。

攝影機 — 持續進行的推位

包裝整個場景。放大尺寸確保邊緣不暴露。

const Camera: React.FC<{children: React.ReactNode; durationInFrames: number}> = ({
  children, durationInFrames,
}) => {
  const frame = useCurrentFrame();
  const scale = interpolate(frame, [0, durationInFrames], [1.0, 1.08], {
    extrapolateRight: 'clamp',
    easing: Easing.out(Easing.sin),
  });
  return (
    <AbsoluteFill style={{transform: `scale(${scale})`, willChange: 'transform'}}>
      {children}
    </AbsoluteFill>
  );
};

將攝影機放在背景層之上,任何必須固定在畫框邊緣的元素之下。

錯開的卡片堆疊

const cards = ['One', 'Two', 'Three'];
const ms = useMs();

{cards.map((label, i) => {
  const local = frame - i * ms(160);
  const p = interpolate(local, [0, ms(600)], [0, 1], {
    extrapolateLeft: 'clamp', extrapolateRight: 'clamp',
    easing: Easing.out(Easing.poly(4)),
  });
  return (
    <div key={i} style={{
      opacity: p,
      transform: `translateY(${(1 - p) * 40}px)`,
    }}>{label}</div>
  );
})}

退場 — 進場時間的一半

const exitStart = durationInFrames - ms(300);
const out = interpolate(frame, [exitStart, durationInFrames], [1, 0], {
  extrapolateLeft: 'clamp', extrapolateRight: 'clamp',
  easing: Easing.in(Easing.cubic),
});

結構

每個節拍使用 <Sequence from={...} durationInFrames={...}>,直接由 motion-plan 表驅動。每個 Sequence 對應一行。節拍持續時間來自計劃,而非整數。

<Series>
  <Series.Sequence durationInFrames={ms(5200)}><BeatTwo /></Series.Sequence>
  <Series.Sequence durationInFrames={ms(2100)}><BeatThree /></Series.Sequence>
</Series>

確定性

  • 絕不使用 Math.random() — 如果需要隨機散射,從元素索引生成種子。
  • 絕不使用 Date.now() 或 new Date()。
  • 絕不在元件內部進行 fetch。使用 staticFile() / delayRender() 預加載。
  • 盡可能使用 <OffthreadVideo> 代替 <Video>/<Audio> 以保證渲染正確。

常見問題

  • 同時對多個元素使用 filter: blur() 很耗效能 — 限制並發的模糊節點數量,或在素材中預先模糊。
  • 字體加載:使用 @remotion/google-fonts 或圍繞本地 FontFace.load() 使用 delayRender,否則前幾幀會以後備字體渲染。
  • 如果輸入範圍不是單調遞增的,interpolate 會拋出錯誤 — 需要保護計算出的範圍。
  • 除非你特別想要值跑出範圍,否則始終傳入 extrapolateLeft/extrapolateRight: 'clamp'。

附錄 B — HyperFrames / GSAP 配方

HyperFrames 組合 HTML + GSAP 並透過對無頭瀏覽器進行幀採樣來渲染。確定性是強制的。

執行 npx hyperframes docs 查看目前 API。本文件是其之上的動畫標準 — 關於管線(初始化 → 預覽 → 檢查 → 渲染)請參閱 hyperframes 技能。

剪輯規則(違反會導致渲染失敗)

每個有時序的元素都需要 data-start,data-duration,data-track-index 以及 class="clip"。框架擁有 .clip 的顯示與轉換控制權。

絕對不要對 .clip 元素本身使用 GSAP。 動畫一個子包裝器。

<div class="clip" data-start="4.2" data-duration="5.2" data-track-index="2">
  <div class="cam">           <!-- 攝影機在此移動 -->
    <div class="inner">       <!-- 元素動畫在此 -->
      <h1 class="headline">…</h1>
    </div>
  </div>
</div>

時間軸註冊

const tl = gsap.timeline({paused: true});
window.__timelines['main'] = tl;   // id 必須與 data-composition-id 匹配

始終暫停。渲染器會調用它。

緩動對照表

表格名稱GSAP
out-expoexpo.out
out-cubicpower2.out
out-quintpower4.out
out-back(上限)back.out(1.2)
in-out-cubicpower2.inOut
out-sinesine.out
in-cubic(退場)power2.in

文字 — 逐字彈出模糊淡入

在作者時間將文字拆分為單字 span(不要依賴運行時分割器 — 它可能會與第一個採樣幀競爭)。

<h1 class="headline">
  <span class="w">What</span> <span class="w">looks</span>
  <span class="w accent">like</span> <span class="w">discipline</span>
</h1>
tl.from('.headline .w', {
  y: 18,
  opacity: 0,
  filter: 'blur(12px)',
  duration: 0.48,
  ease: 'expo.out',
  stagger: 0.07,
}, 0);

// 重點字最後著陸且不同
tl.from('.headline .accent', {
  scale: 0.96,
  color: 'var(--surface)',
  duration: 0.5,
  ease: 'expo.out',
}, 0.18);

攝影機

動畫 .cam,絕不 .clip。

tl.fromTo('.cam',
  {scale: 1.0},
  {scale: 1.08, duration: 5.2, ease: 'sine.out', force3D: true},
0);
.cam { will-change: transform; transform: translateZ(0); }

將移動圖層放大約 6% 超過畫框,確保在推拉或漂移時邊緣永遠不會暴露。

錯開的卡片堆疊

tl.from('.card', {
  y: 40, opacity: 0,
  duration: 0.6, ease: 'power4.out', stagger: 0.16,
}, 1.2);

// 掃光在面板著陸後 150ms 發生
tl.fromTo('.card .sweep', {xPercent: -140}, {
  xPercent: 140, duration: 0.7, ease: 'power2.inOut', stagger: 0.16,
}, 1.35);

筆觸描繪

tl.fromTo('.connector', {drawSVG: '0%'}, {drawSVG: '100%', duration: 0.8, ease: 'power2.inOut'});
// 沒有 DrawSVGPlugin?使用 stroke-dasharray/offset:
tl.fromTo('.connector', {strokeDashoffset: 1000}, {strokeDashoffset: 0, duration: 0.8, ease: 'power2.inOut'});

嚴守規則

  1. 僅確定性 — 沒有 Math.random(),沒有 Date.now(),沒有 fetch,沒有 repeat: -1。
  2. 9:16 = 1080×1920。 設定 #root { container-type: size; } 並以 cqw/cqh(1cqw = 10.8px)調整所有尺寸,絕不使用 vw/vh。
  3. 相鄰的同軌道剪輯不可接觸。 浮點運算會使 3.2 + 0.35 = 3.5500000000000003,這會和從 3.55 開始的剪輯重疊,觸發 overlapping_clips_same_track。留下間隙,或使用像 0.34 這樣的持續時間。
  4. 音訊: 影片為 muted;使用單個預混的主幹 <audio> 軌道(VO + SFX 用 ffmpeg adelay + amix 混合)放在高優先順位的專用 data-track-index 上。多個 <audio> 元素會在同一個無頭實例上競爭,導致定時漂移。

Individual skills in this repo

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

blixvip/skills

Source, generate, and prepare the real assets that keep a motion-graphics edit from looking generated — sampling the palette from the footage, collecting style references, pulling 3D models/Lottie/SVG/textures/SFX, generating AI stills and b-roll, and the mandatory conform pass that grades every asset into one palette. Use when a scene needs an icon, logo, 3D object, texture, background, screenshot, chart source, sound effect, or generated image/video, and whenever output "looks flat", "looks stocky", "looks AI", or assets came from different places and no longer match.

blixvip/skills

Design the actual frames for motion graphics and generated UI — palette derived from the footage, type pairing, one of five scene archetypes, and the layering order that produces depth instead of flat AI slop. Use when building scenes in Remotion, HyperFrames, After Effects, or any generated-image pipeline (Nano Banana / GPT Image / Seedream), and whenever output "looks AI-generated", "looks flat", "looks like a template", or needs to match a creator's branding.

blixvip/skills

The end-to-end runbook for turning raw footage plus a script into a finished, non-sloppy edit — stage order, quality gates, on-disk artifact layout, engine choice, parallel shot builds, and the ship checklist. Use this as the FIRST skill whenever the ask is "edit this video", "make me a video", "add motion graphics to this", "one-shot this edit", or any request that spans more than a single isolated animation. It sequences motion-plan, motion-assets, motion-design and motion-animate; do not run those ad hoc when a whole edit is in scope.

blixvip/skills

Turn a script or timestamped transcript into a shot-by-shot motion plan — which lines earn an on-screen visual, which stay bare A-roll rest, what each visual must show, and how long it holds. Use BEFORE designing or animating anything in Remotion, HyperFrames, or After Effects. Triggers on "plan this edit", "what should be on screen", "storyboard this script", "beat map", "where do the animations go", or any request to animate a video that arrives without a shot list.

相關技能