Communitygithub.com

loop-cover

將電子報或部落格封面轉換為無縫循環 GIF,尺寸 896 x 640,180 幀,20fps。僅移動您指定的單一元素,循環經過旋轉使第 1 幀顯示完成圖像,接縫經由測量而非目視判斷。當有人要求時使用。

loop-cover 是什麼?

此技能「loop-cover」專為開發者與 AI 代理設計,可將靜態封面(PNG 或 HTML)轉換為高品質、無縫循環的 GIF 動畫,規格為 896×640 畫素、180 幀、20fps(總長 9 秒)。其獨特之處在於僅移動使用者指定的單一元素(例如「燈塔光束」或「橙色線條」),其餘部分保持完全靜止,避免常見的過度動畫問題。技能內建自動測量接縫差異(幀 1 與最後一幀的畫素差)與運動幅度(所有幀相對於幀 0 的最大差異),並提供目標數值:接縫 0.0–0.3、運動幅度約 0.7–2.8、檔案大小 0.6–2.3 MB。支援 Claude Code 等 CLI 代理,依賴 ffmpeg 與 Python 進行編碼與驗證,並強調無抖動編碼以保持平面影像清晰。適合電子報、部落格或社群媒體封面,讓動畫在靜態資訊流中脫穎而出。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/charlie947/motion-graphics-skills/tree/main/skills/loop-cover

在你喜歡的 AI 中提問

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

說明文件

循環封面 GIF

能動的封面在滿是靜態圖片的資訊流中會吸引目光。前提是動作要小、循環絕不跳動,且第一幀本身仍然有意義。

開始之前: 如果存在,請閱讀 brand.md 與 MOTION.md。如果不存在,請先執行 brand-intake,或詢問色碼、字型與標誌檔案。沒有這些資訊,切勿聲稱結果符合品牌。

步驟 1:要求三件事,然後等待

  1. 封面。 一張完成的靜態圖片(PNG)或以 HTML 構建的封面。尺寸為 896 x 640,或具有相同 7:5 比例的大圖。
  2. 會移動的單一元素, 單純命名即可。「燈塔光束。」「橙色線條自行繪製。」「儲存格之間的線條。」
  3. 如何移動。 脈衝、繪製、緩慢漂移或發光。一個動作,不是三個。

步驟 2:建立它

如果封面是 HTML: 僅將命名的元素動畫化為純時間函數,加入 window.seek(seconds),並以 20fps 捕捉 180 幀(9 秒)。

如果封面是圖片: 在程式碼中將靜態圖片動畫化。透過顏色(例如藍色遠強於紅色的每個畫素)製作出命名元素的遮罩,將其邊緣柔化數個畫素,然後僅逐幀改變那些畫素。遮罩外部沒有任何東西移動。

對於兩者,在 9 秒內使用一個乾淨的正弦週期或一次繪製、保持與淡出,使最後一幀流暢地接回第一幀。

旋轉循環,使第 1 幀為完成圖。 收件匣與連結預覽會將第 1 幀顯示為靜態圖片。第 i 幀繪製 ((i + offset) mod 180) / 20 秒的瞬間,其中 offset 將完全繪製的狀態放在最前面。

使用無抖動編碼,因為抖動會為平坦影像的每一幀增加閃爍:

ffmpeg -y -framerate 20 -i f%03d.png -filter_complex "split[x][y];[x]palettegen=max_colors=128:stats_mode=full[p];[y][p]paletteuse=dither=none" -loop 0 cover.gif

步驟 3:測量它

ffmpeg -v error -y -i cover.gif -vf scale=216:154,format=gray -f rawvideo frames.raw
python3 -c "
n = 216 * 154
d = open('frames.raw', 'rb').read()
f = [d[i:i + n] for i in range(0, len(d), n)]
diff = lambda a, b: sum(abs(x - y) for x, y in zip(a, b)) / n
print('frames', len(f))
print('seam', round(diff(f[-1], f[0]), 2))
print('excursion', round(max(diff(x, f[0]) for x in f), 2))
"

根據我已交付封面的目標:180 幀,接縫 0.0 至 0.3,運動幅度約 0.7 至 2.8,檔案大小介於 0.6 至 2.3 MB。運動幅度接近零表示沒有任何可見的東西移動。

我學到的慘痛教訓

  • 「你把整張圖都改了。」 我的第一個 GIF 橫掃整個畫面的頻寬。只動畫化了命名的那個東西。
  • 影像模型會加入鏡頭移動。 告訴它「相機完全不動」,它還是會推進。在程式碼中將靜態圖片動畫化是鎖定相機的唯一方法。
  • 絕不在中途幀測量運動。 正弦在那裡回到零,因此一個正常的動畫會回報無運動。測量與第 0 幀相比的最大變化。
  • 在 ffmpeg 的 eq 濾鏡中,加入 eval=frame, 否則表達式只執行一次,什麼都不會動。
  • 將它縮小到 240 像素寬再檢查一次。 那是收件匣中的大小。如果移動的元素消失,就表示太小了。
  • 上傳 GIF 檔案本身。 某些上傳工具會轉換為 PNG,動畫便悄然消失。檢查上傳的連結仍然以 .gif 結尾。

Individual skills in this repo

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

animated-chart

Make a looping animated chart for LinkedIn or a newsletter in code with Claude Code. Bars that become a line, a number that counts up, a before and after. Every value stays exactly as given. Use when someone says

apple-launch-film

Rebuild an Apple-style Mac launch film entirely in code with Claude Code. A thin menu bar, the black notch growing into widgets one scene at a time, full-screen gradient wallpapers and one short caption per scene. No screen recording, no After Effects. Use when someone says

brand-intake

The setup step every other skill in this pack reads. A short interview plus 3 to 5 reference frames becomes two files in your project, brand.md (who you are, what you sell, your assets) and MOTION.md (your colours, type, timing and motion rules), plus a rule in CLAUDE.md so Claude reads them before it animates anything. Use at the start of any motion project, or when someone says

launch-video

Make a 30-45 second product launch video in code with Claude Code, the kind SaaS companies post on launch day. One sentence split across scenes, real product screens with slow camera moves, a typed prompt, a proof beat and a clear call to action. Use when someone says

milestone-reveal

Make a 12-second looping milestone clip in code with Claude Code. Thousands of tiny points drift like a night sky, pull together into your real number (followers, subscribers, revenue, customers), a line draws underneath and the label settles in. Premium, not a party. Use when someone says

model-showdown

Give the same motion brief to three AI models, keep each first try, render all three the same way and stack them into one comparison video with model names and logos. Makes a 16:9 side-by-side for a newsletter and a 1080 x 1920 stacked reel for Instagram and TikTok. Use when someone says

motion-brief-writer

Turns a rough idea for an animated graphic into a precise build brief for Claude Code, in your own brand. Asks for anything essential first (exact numbers, size, length, brand), keeps real results apart from sample data, and never invents a figure. Use when someone says

motion-effects

Build any of 16 premium motion effects from scratch in your own brand, as one 8-second looping HTML file with window.seek(seconds) so it exports frame-exact to MP4 or GIF. Interfaces (button to player, search to results, card to workspace, tabs to panels), data (chart morph, dashboard zoom, spring stack, magnetic dock), type (masked type, elastic type, text to layout, image reveal) and systems (perspective shift, glass focus, flowing paths, particle logo). Use when someone says

motion-prompt-writer

Write a complete 8-part Claude Motion prompt (The bar, Format, The one rule, Look, Motion, Never, Before you finish, The scene) for one short looping motion graphic, in your own brand. Takes your brand (a website screenshot, a logo, hex codes, or nothing for the Apple-style default) and one moment you want to show, in plain words. Use when someone says

newsletter-promo

Turn a newsletter edition into a 12-20 second promo clip for LinkedIn, Instagram or X that drives people to read and subscribe. Hook question, three proof frames from the edition, then the newsletter name and where to read it. Use when someone says

reel-export

Turn any horizontal or square motion video into a 1080 x 1920 Instagram Reel or TikTok that uploads cleanly. Headline and logos inside the safe zone, H.264, yuv420p, limited colour range, bt709, a silent audio track when there is no sound, and an ffprobe check before upload. Use when someone says

reference-to-motion

Turn references you admire into a scene-by-scene Claude Motion prompt for your own topic and brand. Takes a video for the moves (screenshots, frames or a contact sheet of a reel or ad) and, optionally, a look reference for the style (a website, a brand, a moodboard). Use when someone says

title-sequence-3d

Make a cinematic 3D title sequence (8-15 seconds) in code with Claude Code and Three.js. A camera moves through a lit scene, such as a rainy street at night with brand names as neon signs, then a big question or title lands. Use when someone wants a scroll-stopping opener, a film-style intro,

vox-explainer

Make a short Vox-style documentary explainer (30-60 seconds) entirely in code with Claude Code. Torn paper, halftone texture, bold condensed type, motion on twos. Use when someone says

相關技能