Particle Logo

用單一 HTML 檔案為網站加上 Logo 粒子動畫

HTML 匯出是將 Logo 動畫放上網站最快的方式:單一檔案、免建置步驟、零外部函式庫。

更新於

您會取得什麼

1. 匯出檔案

  1. 開啟工坊。
  2. 上傳 Logo:點擊選擇 PNG、SVG、JPG 或 WebP 檔案,也可直接拖曳至頁面或按 Ctrl+V / ⌘+V 貼上。透明或純色背景效果最佳;若有缺漏可調整點陣密度與提取閾值。
  3. 從 16 種效果中任選一款,調整粒子大小、形狀(方塊或圓點)與速度。
  4. 點擊匯出程式碼,切至 HTML5 單檔 分頁並點選下載檔案(或複製程式碼)。此格式免費版即可使用。

2. 更換效果或調整節奏

打開 index.html,於 <script> 頂端即可見以下設定(範例數值):

const rawPoints = [...];         // your logo's points: [x, y] or [x, y, color]
const defaultColors = [...];     // particle colors, used when a point has no color of its own
const variant = 'condense';      // which effect plays
const baseParticleSize = 1.8;    // base particle size, scaled to the card
const particleShape = 'square';  // 'square' or 'circle'
const speedMultiplier = 1;       // how fast particles move toward their targets
const duration = 3.2;            // seconds per cycle; a 1.2 s hold follows

將 variant 改為下表任一值即可切換效果。粒子尺寸依卡片大小等比縮放:繪製尺寸 = baseParticleSize × 卡片較短邊 ÷ 400,最小 1 px。

variant 值效果
condense量子凝聚態
mobius-flow莫比烏斯拓撲光流
vortex星系引力坍縮
scan全息光柵斷層掃描
diffusion-denoise擴散降噪重構
flux-wave超導磁通漣漪
swarm-assembly奈米蜂群智慧組裝
gravitational-slingshot引力彈弓時間逆流
cymatics-resonance克拉尼聲波共振
curl-flow量子旋度流場
orbital-sphere3D 球面經緯展開
matrix-rain賽博矩陣數字雨
cyber-glitch賽博故障切片
manhattan-lattice正交晶格步進
origami-fold鏡像摺紙展開
helix-weave利薩如雙螺旋
biolum-pulse生物螢光脈動
glyph-dissolve字元群翼消散

3. 嵌入您的網頁

方法一:使用 iframe 嵌入(最簡便且樣式隔離)

將 index.html 上傳至您的網站(例如 /particle-logo/index.html),接著加入:

<iframe src="/particle-logo/index.html" title="Logo 動畫"
        width="480" height="520" style="border:0" loading="lazy"></iframe>

該檔案會在黑色頁面中央建立一張最大 480 × 520 px 的卡片並於其中繪製動畫。

方法二:直接將程式碼貼入頁面

複製 .card 元素、.card / canvas / .hint 樣式與 <script>;請勿複製 body 樣式以免覆蓋整頁背景與捲軸。腳本依 id="card" 與 id="canvas" 尋找節點,請保持頁面中 ID 唯一。

Framer、Webflow 與各類建站工具

Pro 提供 Framer / Webflow 專用嵌入碼(framer-webflow-embed.html),會自動填滿容器(高度至少 420 px),直接貼入建站工具的嵌入區塊即可。

4. 效能與無障礙

點陣資料(JSON)

點雲 JSON 匯出(Pro 方案)為包含所有採樣點的陣列:

[
  { "x": 132.5, "y": 88, "alpha": 0.8, "color": "rgb(66, 133, 244)" },
  { "x": 136.5, "y": 88, "color": "rgb(66, 133, 244)" }
]
進入工坊

其他教學