💧 Ripple Effect Generator
📐 計算公式 / 原理
顏色解析:#RRGGBB → rgba(R, G, B, 0.5);漣漪直徑 = max(盒寬, 盒高);圓心定位 = 點選座標 − 盒子偏移 − 半徑;動畫 scale(0) → scale(4) 後淡出,時長 dur 秒自動移除
漣漪動效 = 點選處生成圓形偽元素並放大 + 淡出(transform / opacity 過渡);引數化顏色、擴散半徑與時長並匯出 CSS / JS,用於 Material 風格按鈕。
📚 深度解析:漣漪效果生成器
💡 常見使用場景
- 按鈕反饋。
- 卡片點選。
- Material 風格。
生成水波點選
輸入:色 #FF6B35、0.6s。
處理:生成擴散動畫。
輸出:程式碼與預覽。
❓ 常見問題(FAQ)
- 要 JS 嗎?
- 純 CSS 難定位點選點,精準漣漪通常需少量 JS 驅動。
- 漣漪色怎麼定?
- 取半透明主題色,淺底上更明顯;可隨元件配色調整。
- 會儲存或上傳我的內容嗎?
- 結果以瀏覽器即時計算為準,純前端本地處理、資料不上傳;生成的樣式與程式碼僅作快速產出參考,正式專案請以設計系統、規範與瀏覽器實測為準。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Ripple radius | radius spans the distance from the touch point to the farthest corner | Euclidean geometry |
| Compositor animation | animating transform and opacity stays on the compositor | CSS Transforms Level 1 |
| Motion preference | shorten or drop the ripple under reduced motion | WCAG 2.2 (2.3.3) |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準