Communitygithub.com

map-route

建立三維地圖路線垂直動畫 (1080x1920),適用於短影音,使用 three.js 呈現。包含白色 3D 城市、公園、河流,路線自繪並跟隨鏡頭移動,紅色圖釘彈跳動畫,即時 ETA 倒數卡片與目的地卡片。

map-route 是什麼?

map-route 是一個專為短影音(Reels)設計的三維地圖路線動畫生成工具,輸出 1080x1920 的垂直影片。它使用 three.js 建構乾淨的白風格 3D 城市場景,包含公園、河流等地標,路線會自動繪製並帶有鏡頭跟隨效果。工具支援多種平台(需透過 headless Chrome 與 WebGL 渲染),內建視覺品質檢查機制,並可自訂路線形狀、配色、種子數值等進階選項。使用者只需提供目的地名稱、時間與距離,系統會自動生成完整的動畫影片與靜態預覽圖,並附帶 ETA 倒數卡片與目的地卡片。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hieubm1707/gemini-animation-skills/tree/HEAD/skills/map-route

在你喜歡的 AI 中提問

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

說明文件

3D 地圖路線 (map-route)

┌──────────────────────┐
│ [▲ 9 分鐘]           │  ETA 卡片倒數,結束後顯示「已送達」
│      ┌鐵人健身房┐    │  目的地卡片在圖釘落地後顯示
│  ▒▒   ▒▒   📍  ▒▒    │  白色 3D 方塊、公園、河流
│  ▒▒ ━━━━━━━┛   ▒▒    │  路線自動繪製,鏡頭沿線移動
│  ▒▒ ┃  ▒▒      ▒▒    │  最後拉遠全景
└──────────────────────┘

設定檢查

SKILL_DIR 是包含此 SKILL.md 檔案的目錄(請檢查 <skills> 中的路徑)。

SKILL_DIR="$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "<包含此 SKILL.md 的目錄>")"
KIT="$(python3 -c 'import os,sys; print(os.path.realpath(os.path.join(sys.argv[1], "..", "..", "kit")))' "$SKILL_DIR")"
[ -s "$KIT/node_modules/three/build/three.module.js" ] || bash "$KIT/setup.sh"

需要 ffmpeg、node (18+)、python3 (3.9+),以及透過 headless Chrome 的 WebGL 支援。

步驟

  1. 收集行程詳細資料。 取得目的地名稱、旅行時間 (minutes) 和 distance(例如「家到健身房,2.8 公里,9 分鐘」)。如果只給了時間或距離其中一項,請估算另一項(步行約 12 分鐘/公里,騎車約 4 分鐘/公里,市區駕車約 2 分鐘/公里)並告知使用者。
  2. 撰寫規格檔。 使用以下 schema 建立 <name>.map.json。
  3. 驗證與快速快照。
    python3 "$SKILL_DIR/build.py" <name>.map.json --check
    python3 "$SKILL_DIR/build.py" <name>.map.json --snap 3.8
    
    在進行完整 3D 渲染前,使用 read_file 檢查快照 PNG。
  4. 渲染。 執行:
    python3 "$SKILL_DIR/build.py" <name>.map.json
    
    約需 1.5 分鐘(headless Chrome 中的 WebGL;來自 HyperFrames 的 sub_timeline_readiness_timeout 警告屬正常現象)。
  5. 視覺品質檢查(必要)。 使用 read_file 檢查 <name>.map.sheet.jpg:
    • 目的地卡片需完全位於紅色安全區域框內,且無裁剪。
    • 街道/地點標籤不得與 ETA 卡片或目的地卡片重疊。
  6. 交付。 回傳 .mp4 與 .sheet.jpg 的可點擊連結。

規格 Schema

{
  "destination": "Iron Yard Gym",
  "minutes": 9,
  "distance": 2.8,
  "unit": "km",
  "places": ["North Quay", "Botanic Gardens", "Market Hall", "Elm Park", "The Canal"],
  "accent": "#2f7cf6",
  "seed": 7
}
  • destination、minutes、distance(必要)。destination 請勿超過約 26 個字元。
  • unit:"km" 或 "mi"。
  • places:5 個簡短灰色標籤,固定對應地圖位置:[近起點、最左公園、路線中間區塊、最右公園、河流]。可使用在地化名稱,或設為 "" 隱藏任何標籤。
  • accent:6 位數十六進位顏色碼,用於路線、移動點與 ETA 圖示。圖釘保持紅色。
  • seed:任意整數,可改變建築物與公園佈局。
  • hold(選擇性):結尾多停留的秒數。
  • out(選擇性):自訂輸出 .mp4 路徑。

自訂路線形狀(進階)

預設路線為向上、向右、向上、向右。若要更改,請將 "$SKILL_DIR/template.html" 複製到規格檔旁,在規格中加入 "template": "template.html",並編輯 WP([x, z] 路徑點,需位於街道網格 4 的倍數上;x 範圍 -36..36,z 範圍 -88..24,北方為 -z)。更新最終拉遠目標(new THREE.Vector3(3, 0, -27))與 LBL 位置以符合,然後使用 --snap 3.8 驗證。

風格規則

  • 使用簡短、真實的地點名稱;目的地卡片可舒適容納約 26 個字元。
  • 保持簡潔:一條路線、一個紅色圖釘,不要有多餘箭頭或標註。

Individual skills in this repo

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

breakdown

Makes a 3D exploded-view vertical animation (1080x1920) for a reel using three.js. A phone floats on a dark studio backdrop, separates layer by layer (glass, OLED screen, frame, logic board, battery, back), and draws thin leader lines to numbered labels. Use when the user asks for /breakdown, an exploded view, a "what's inside" teardown, or a labelled 3D hardware breakdown.

graph

Makes a minimal vertical (1080x1920) line-graph animation for a reel. A smooth black line draws itself on white (or white on black) while one large number counts up with the tip and lands on the final value. Use when the user asks for /graph, a growth chart, a "0 to 100K" number counter, an animated stat, or a minimal metric line chart.

low-poly

Makes a PS1/N64-era retro low-poly 3D vertical animation (1080x1920) for a reel using three.js. Chunky low-res nearest-neighbour pixels, vertex snapping, dithering, warm flat lighting, and small yellow captions with a thin black outline. Built-in scene: a dog waits on a station platform while a train arrives and leaves, and seasons turn to snow. Use when the user asks for /low-poly, PS1-style, N64 retro 3D, or "low poly shorts" animations.

minimalistic-graphics

Makes a minimal black-and-white line-art vertical animation (1080x1920) for a reel. Thin outlined steps rise one by one, a white dot hops up them, an orbit with sparks draws around the dot at the top, and one quiet lowercase line swaps to a second line. Use when the user asks for /minimalistic-graphics, simple black-and-white motion graphics, calm self-improvement visuals, or line art with one moving dot.

相關技能