🎲 Particle Effect Generator
Batch-produce runnable CSS particle effects: set the particle count, animation period and colour per scheme (leave blank for random); each scheme ships ready-to-paste HTML particles plus CSS with the animation already bound, and renders a live preview.
📐 工作原理與說明
生成條數鉗制在 1–50(預設 5);第 i 條按 i 對 4 取模迴圈選取 circle、square、diamond、star 四種形狀(用 clip-path 實現,不與 transform 動畫衝突);每套的粒子數 20–200、顏色、尺寸 2–10 px、週期 0.3–3.0 s、擴散半徑 50–300 px、透明度 0.3–0.8 可指定或留空隨機。輸出為「HTML 粒子節點 + CSS」:.particles-N .p 繫結 animation: float-N var(--speed) linear infinite,--size / --color / --speed / --spread / --opacity 全部被引用,每個粒子另帶 left、animation-delay 與 --dx。關鍵幀:0% 下移一個擴散半徑、透明度 0;20% 升到設定透明度;100% 上移一個擴散半徑並橫向偏移 --dx、透明度回到 0
基於 CSS 關鍵幀的粒子系統:每個粒子是一個絕對定位的 span,靠 clip-path 決定形狀、靠 CSS 變數與 keyframes 完成上浮與淡入淡出,不依賴 JavaScript 執行時;輸出為可直接貼上執行的 HTML + CSS 兩段程式碼,並給出即時預覽。用於網頁背景與活動頁特效。
📚 深度解析:粒子特效生成器(可配置引數)
💡 常見使用場景
- 網頁背景特效。
- 活動頁粒子。
- 教學 canvas 動畫。
生成上浮粒子
輸入:粒子 80、速度慢、橙白。
處理:canvas 即時繪製。
輸出:預覽與匯出程式碼/圖。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
❓ 常見問題(FAQ)
- 粒子多了卡嗎?
- 數量越大越耗 GPU/CPU,移動端建議降低數量。結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
- 生成的程式碼/圖片能直接用嗎?
- 可直接複製使用,建議粘到專案後在瀏覽器實測微調;本工具只生成不託管。
- 會儲存或上傳我的內容嗎?
- 結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Keyframe interpolation | transform and opacity are interpolated between the 0% / 20% / 100% keyframes on the compositor thread | CSS Animations Level 1 |
| HiDPI friendly | particles are drawn from CSS variables and clip-path, so they render in device-independent pixels without any DPR canvas scaling | CSS Shapes / clip-path |
| Staggered phases | a negative animation-delay offsets particles within the same animation period so the batch does not rise in lockstep | CSS Animations Level 1 |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準