Communitygithub.com

hacimertgokhan/geomotion

從基本形狀創建手繪、變形線條動畫(沸騰墨跡、類似RISO風格的填充),並匯出為動畫SVG、Lottie JSON、HTML或可分享連結。當使用者想要動態圖示、載入動畫、插圖、解說動畫、Logo動態、空狀態或成功動畫、「手繪」/「草圖」/「塗鴉」風格的動畫,或要求使用geomotion時使用。

geomotion 是什麼?

geomotion 是一個強大的動畫生成工具,能將 JSON 規格(spec)轉換為具有手繪風格、會「沸騰」的動畫。它支援多種形狀(圓形、矩形、多邊形、路徑等)和豐富的變形、淡入淡出效果,非常適合建立動態圖示、載入動畫、插圖解說或 Logo 動態。動畫可以利用 MCP 工具(`geomotion_guide`、`geomotion_render` 等)、CLI 命令(`npx`)或手寫規格後透過 Python 腳本取得播放器連結來生成。它支援多種匯出格式:動畫 SVG、Lottie JSON 和 HTML,並能產生可分享的播放器連結,讓使用者直接在瀏覽器中調整與匯出。Geomotion 適用於 Claude Code、Cursor、Codex 等環境,無論是開發介面元素、自然主題、溝通動畫或抽象圖形,都能快速產出高品質的手繪風格動畫。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/hacimertgokhan/geomotion/tree/HEAD/skills/geomotion

在你喜歡的 AI 中提問

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

說明文件

geomotion 是做什麼的?

geomotion 將一個 JSON 規格(spec)——一個關鍵影格(keyframes)列表,每個影格包含一系列形狀——轉換為手繪風格的動畫。相同 id 的形狀會在關鍵影格之間互相變形;線條會持續「沸騰」(約 12 次/秒重新描繪),因此結果感覺像是用手繪製而成。

網站與工作室:https://hacimertgokhan.github.io/geomotion · 儲存庫:https://github.com/hacimertgokhan/geomotion

工作流程

  1. 選擇一種方式(使用第一個可用的方式):
    • MCP 工具(geomotion_guide、geomotion_get_preset、geomotion_render、geomotion_share_link):先呼叫 geomotion_guide 一次,然後再渲染。
    • CLI(需 Node 18+ 且有網路連線):npx -y github:hacimertgokhan/geomotion render spec.json --both --formats svg,lottie,html
    • 無工具:編寫規格,然後執行 python scripts/link.py spec.json(在此技能資料夾中)以取得一個播放器/工作室連結,使用者可以從中打開、編輯並匯出。
  2. 當有接近的預設時從預設開始(參閱下方的目錄)並調整 id、位置、顏色。
  3. 按照以下規則編寫規格。進行驗證(MCP geomotion_validate 或 geomotion check spec.json)。
  4. 交付:檔案路徑和/或播放器連結。提及工作室連結,以便他們能調整。當動畫將放在網站上時,提供透明版本(transparent: true 或 "both")。

規格要點

{
  "name": "idea",
  "size": [1200, 1200],
  "fps": 24, "boil": 12, "loop": true,
  "background": "ivory",
  "hold": 0.7, "duration": 0.9, "ease": "inOutCubic",
  "style": { "width": 24, "wobble": 1, "misregister": [-14, 10] },
  "keyframes": [
    { "shapes": [ { "id": "bulb", "type": "circle", "cx": 600, "cy": 520, "r": 220, "fill": "oat" } ] },
    { "hold": 1.2, "shapes": [
      { "id": "bulb", "type": "circle", "cx": 600, "cy": 520, "r": 240, "fill": "sun" },
      { "id": "ray", "type": "line", "from": [600, 200], "to": [600, 110], "enter": "draw", "delay": 0.3 }
    ] }
  ]
}
  • 關鍵影格:hold(顯示的秒數)、duration(變形到下一個關鍵影格的時間)、ease。
  • 形狀類型:circle {cx,cy,r}、ellipse {cx,cy,rx,ry}、rect {x,y,w,h,radius?} 或 {cx,cy,w,h}、 line {from,to}、polyline {points,closed?}、polygon {points}、regular {cx,cy,r,sides}、 triangle {cx,cy,r}、star {cx,cy,r,inner?,points?}、heart {cx,cy,size}、blob {cx,cy,r,seed?}、 crescent {cx,cy,r,thickness?,angle?}、wave {from,to,amplitude?,waves?,phase?}、spiral {cx,cy,r,turns?}、 arc {cx,cy,r,start,end}(度數,0 為右方,順時針)、path {d}(任何 SVG 路徑)。
  • 形狀選項:id(在不同關鍵影格間匹配——請務必設定)、fill、stroke(顏色或 false)、 width、opacity、enter/exit(grow | pop | draw | fade | cut)、delay(0–0.95,交錯)、 ease、transform {translate, rotate, scale, origin}、misregister: false(用於微小的實心點)。
  • 色盤名稱:ink, slate, ivory, paper, oat, kraft, clay, coral, fig, sky, cactus, olive, heather, sun, white(或任何十六進位色碼)。
  • 緩動函數:linear, in/out/inOut Quad·Cubic·Sine, inOutQuart, outExpo, inOutExpo, outBack, inOutBack, outElastic, outBounce。

讓它看起來更好的設計規則

  1. 1200×1200 畫布,約 120 像素邊距,每個姿勢使用 2–5 個粗體形狀。小細節難以閱讀。
  2. 每個輪廓使用 ink,每個姿勢使用一或兩個重點填充色(oat, clay, sun, sky, cactus, coral)。
  3. 透過 id 講述故事:同一個元素會變換(太陽 → 月亮,信封 → 紙飛機,圓點 → 愛心)。
  4. 使用 delay 0 / 0.15 / 0.3 交錯;對應感覺像是書寫出來的線條使用 "enter": "draw",對應俏皮的出現使用 "pop"。
  5. 停留時間 0.5–1.2 秒,變形時間 0.5–1.2 秒。inOutCubic = 平靜,inOutBack/outBack = 俏皮,outElastic = 果凍感。
  6. 兩個關鍵影格之間的旋轉角度 > 30° 會使線條產生尖角——將大的旋轉拆分為多個關鍵影格(請參閱 spinner、gears、orbit 預設)。
  7. 實心點(眼睛、打字點):"stroke": false, "fill": "ink", "misregister": false。

預設目錄(起點)

  • 介面:loader, spinner, success, error, toggle, bell, search
  • 自然:sunrise, sprout, rain, night, sea
  • 溝通:chat, send, like, connect
  • 想法:idea, growth, target, gears, house
  • 角色:smile, ghost, sparkle
  • 抽象:drift, orbit, kaleido, pebbles
  • 動態:bounce, pendulum, jelly

任何預設可直接開啟:https://hacimertgokhan.github.io/geomotion/play/#preset=<name> (加上 &bg=0 以獲得透明背景)或在工作室中:/studio/#preset=<name>。

在網站上嵌入

<script type="module" src="https://hacimertgokhan.github.io/geomotion/src/embed.js"></script>
<geo-motion preset="success" transparent style="width:160px"></geo-motion>
<geo-motion code="z…"></geo-motion>   <!-- 分享連結的 #s=… 部分 -->

相關技能