Communitygithub.com

thatrebeccarae/claude-marketing

Remotion 影片製作的實戰技巧 — 彈簧動畫、插值模式、SVG 繪製效果、場景轉場、圖表動畫、音訊整合與渲染。適用於用 Remotion 建立程式化影片、製作動畫內容或程式碼行銷影片時使用。

claude-marketing 是什麼?

這個技能「thatrebeccarae/claude-marketing」提供了 Remotion 影片製作的完整最佳實踐指南。它涵蓋了從彈簧動畫預設、插值技術到 SVG 繪製效果、場景轉場與圖表動畫等核心能力,並針對大型語言模型代理(如 Claude Code、Cursor、Codex)最佳化,讓開發者能夠透過自然語言指令快速生成高品質的程式化行銷影片。技能內建了多種動畫模式(彈跳、流暢、清脆、交錯)與圖表模式(長條圖成長、折線圖繪製、圓餅圖揭示、數字計數),並強調效能規則(避免 useEffect、使用 React.memo 與 staticFile 預載資源)與反模式(禁止 CSS transition、setTimeout、絕對像素定位等)。支援 Remotion 生態系中的 TransitionSeries 與 @remotion/transitions 套件,並提供完整的程式碼範例與組合模板,適合用於建立品牌宣傳、產品演示或社群媒體影片。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/thatrebeccarae/claude-marketing/tree/HEAD/skills/remotion-video

在你喜歡的 AI 中提問

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

說明文件

Remotion 影片製作

使用 Remotion 建立程式化影片的最佳實踐 — 動畫、轉場、圖表與渲染。

安裝

git clone https://github.com/thatrebeccarae/claude-marketing.git && cp -r claude-marketing/skills/remotion-video ~/.claude/skills/

核心能力

  • 彈簧動畫預設(彈跳、流暢、清脆、交錯)
  • 插值模式(相機縮放、視差、滾動模擬)
  • SVG 繪製動畫(路徑追蹤、描邊揭示)
  • 透過 TransitionSeries 進行場景轉場
  • AbsoluteFill 圖層合成
  • 圖表動畫(長條圖成長、折線圖繪製、圓餅圖揭示、數字計數)
  • 音訊整合與同步
  • 渲染配置

彈簧動畫預設

使用 Remotion 的 spring() 進行物理基礎動畫:

預設配置使用情境
彈跳mass: 0.5, damping: 8, stiffness: 120俏皮的揭示、標誌彈跳
流暢mass: 1, damping: 15, stiffness: 80UI 轉場、滑入效果
清脆mass: 0.8, damping: 20, stiffness: 200輕快的互動、切換開關
交錯任何預設搭配每個項目的影格偏移列表揭示、網格動畫
import { spring, useCurrentFrame, useVideoConfig } from "remotion";

const frame = useCurrentFrame();
const { fps } = useVideoConfig();

const scale = spring({
  frame,
  fps,
  config: { mass: 0.5, damping: 8, stiffness: 120 },
});

插值模式

相機縮放

import { interpolate } from "remotion";

const zoom = interpolate(frame, [0, 30], [1, 1.5], {
  extrapolateRight: "clamp",
});

視差圖層

const bgX = interpolate(frame, [0, 100], [0, -50]);
const fgX = interpolate(frame, [0, 100], [0, -150]);

滾動模擬

const scrollY = interpolate(frame, [0, 90], [0, -800], {
  extrapolateRight: "clamp",
});

SVG 繪製效果

動畫化 strokeDashoffset 以揭示 SVG 路徑:

const pathLength = 500;
const draw = interpolate(frame, [0, 60], [pathLength, 0], {
  extrapolateRight: "clamp",
});

<path
  d="..."
  strokeDasharray={pathLength}
  strokeDashoffset={draw}
/>

圖表動畫模式

模式技術
長條圖成長將高度從 0 動畫到目標值,每個長條交錯 3-5 影格
折線圖繪製使用 strokeDashoffset 動畫的 SVG 路徑
圓餅圖/甜甜圈圖揭示動畫化 conic-gradient 停點或 SVG 弧形路徑
數字計數從 0 到目標值進行插值,用 Math.round() 顯示

場景轉場

import { TransitionSeries, linearTiming } from "@remotion/transitions";
import { fade } from "@remotion/transitions/fade";

<TransitionSeries>
  <TransitionSeries.Sequence durationInFrames={90}>
    <SceneOne />
  </TransitionSeries.Sequence>
  <TransitionSeries.Transition
    timing={linearTiming({ durationInFrames: 15 })}
    presentation={fade()}
  />
  <TransitionSeries.Sequence durationInFrames={90}>
    <SceneTwo />
  </TransitionSeries.Sequence>
</TransitionSeries>

效能規則

  1. 動畫不要使用 useEffect。 請用 useCurrentFrame() + interpolate()。
  2. 將靜態元件記憶化。 對不依賴影格的任何元件使用 React.memo。
  3. 預載資源。 本地檔案用 staticFile(),遠端網址用 prefetch()。
  4. 開發期間保持組合影片在 30 秒以下,以加速渲染迭代。
  5. 在最終渲染前於目標解析度(1920x1080 或 1080x1080)測試。

反模式

  • 不要使用 CSS transition 或 animation — 使用 Remotion 的 interpolate() 和 spring()
  • 不要使用 setTimeout 或 setInterval — 只基於影格計時
  • 響應式佈局不要使用絕對像素定位 — 使用 AbsoluteFill + flex
  • 不要每個影格重建內聯 style 物件 — 提取到常數或用 useMemo
  • 不要使用不受控的音訊 — 務必設定明確的 volume 和 startFrom

完整的程式碼範例和組合模板請參閱 REFERENCE.md。

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

相關技能