🎲 CSS Keyframe Animation Batch Generator

Batch-generate CSS keyframe animations from 8 built-in templates, set duration, easing, iteration, direction and fill, preview the first one and export the @keyframes code.

📐 工作原理與說明
生成條數鉗制在 1–50(預設 5);第 i 條預設按 i 對 8 取模迴圈選取 fadeIn、slideUp、bounce、pulse、rotate、shake、zoomIn、flip 八種關鍵幀模板,選「動畫型別」則全批統一為所選模板;動畫名 = 模板名 + "-" + 1–999 的隨機整數;時長(0.5–3.0 s)、延遲(0–2.0 s)、緩動、播放次數(1/2/3/infinite)、方向、填充模式六項留空時隨機,填寫即按所選值固定,最後拼裝為 animation 宣告與 @keyframes 程式碼塊。頁面頂部預覽區把第 1 條動畫按它自己的播放次數與填充模式應用到色塊上(@keyframes 以真實 style 元素注入,非僅顯示文本),可直觀判斷動效觀感後再複製程式碼;首次生成後隨機值按條快取,修改單項引數只更新該項,點選「生成(重新隨機)」才重抽全部屬性。
內建模板批次生成:從 8 種固定關鍵幀模板中選取並拼裝 animation 宣告,可統一或隨機設定時長、延遲、緩動、次數、方向與填充模式;第 1 條按生成引數預覽,用於快速產出 CSS 動畫程式碼。

📚 深度解析:CSS動畫生成器(關鍵幀視覺化)

💡 常見使用場景

  • 做入場/迴圈動畫。
  • loading 動效。
  • 教學 keyframes。
生成旋轉動畫

輸入:0→360deg、1s linear infinite。

處理:生成 keyframes。

輸出:@keyframes 與呼叫類。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。

❓ 常見問題(FAQ)

infinite 影響效能?
持續動畫佔主執行緒渲染,複雜場景注意降級。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
生成的程式碼/圖片能直接用嗎?
可直接複製使用,建議粘到專案後在瀏覽器實測微調;本工具只生成不託管。
會儲存或上傳我的內容嗎?
結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。

Formula & Standard References

Item Formula / Note Source / Standard
Keyframe offsets 0 and 100 percent are required, intermediate offsets optional CSS Animations Level 2
Per-keyframe easing an easing inside a keyframe changes speed for that segment CSS Animations Level 2
Compositor-friendly properties prefer animating transform and opacity to avoid layout work CSS Transforms Level 1
⚠️ 使用說明與注意事項