dsh-whale-particles-bg:爲 DSH Web UI 掛上鯨魚粒子背景

前言

DeepSeek Harness(dsh)的 Web 客戶端支持通過 Cordis 插件擴展界面。若你希望在主界面背後增加一層動效背景,而不是改核心倉庫或手寫一次性腳本,社區裏已有面向「趣味換裝」的正式 bundle 包可以一鍵安裝。下面介紹維護者 kviiinh 發佈的 dsh-whale-particles-bg:在框架級 shell.overlay 槽位註冊兩層全屏 canvas,呈現 WHALE 輪廓粒子場與官方風格的點陣網格,並隨指針與主題變化。

社區插件目錄見 SkillHub 插件頁;源碼與說明在 GitHub 倉庫。該目錄爲社區站點,與 DeepSeek / 幻方無官方從屬關係。

這是什麼

dsh-whale-particles-bg 是 dsh Web UI 的正式插件包(bundle 形態):聲明 dsh.bundle,可通過 dsh plugin add 安裝,由包內 cordis.patch.yml 自動插入插件行(id: whale-particles-bg),無需手改 profile 補丁。

一句話能力:Animated whale particle background for the DeepSeek Harness (dsh) Web UI — assembling from its scattered shell, breathing at idle, and being pushed around by the pointer(鯨魚輪廓粒子從散點聚合、空閒呼吸、指針斥力;並帶點陣網格層)。

  • 維護者:kviiinh
  • 分類:趣味換裝
  • 許可證:MIT(package.json)
  • 版本:1.0.0(package.json)
  • peer 依賴:@deepseek-ai/cordis ^4.0.2

核心功能

兩層 canvas

層級 z-index 內容
鯨魚層 1 從 WHALE SVG 路徑採樣的粒子場(24×18 viewBox,6× 離屏柵格化,每 2px 採樣)。粒子從散點 shell 聚合;空閒時呼吸;指針在 4.9 世界單位半徑內沿各粒子旋轉角度產生斥力。
點陣網格層 0 90px 方格點陣、鄰居連線;指針 140px 範圍內吸引並放大圓點。

兩層均爲 fixed、全視口、pointer-events: none 的 canvas,不擋點擊。

主題與性能

  • 主題:每幀讀取 body[data-ds-dark-theme],深色粒子色 rgb(215,232,255),淺色 rgb(50,82,135),無需單獨訂閱主題事件。
  • 幀率:requestAnimationFrame 限約 30fps(FRAME_MS = 33);標籤頁隱藏時瀏覽器會暫停 rAF。
  • 掛載點:shell.overlay(由 @deepseek-ai/dsh-client-ui-layout 聲明的 frame 級 list 槽位)。
  • 頁面背景:global.css 在工廠執行時注入帶標記的 <style>,會覆蓋 body 背景(含 !important)。

bundle 行爲

安裝時會把包追加進 profile 的 dsh.profile.bundles,並由 cordis.patch.yml 寫入插件行。倉庫提交 lib/ 構建產物,瀏覽器側爲 window.__ModuleLoader__.load({ id, factory }) bundle,git 安裝後無需本地 build。Node 半邊(src/index.ts)爲空 apply,純 UI 插件只需出現在 Loader 中。

安裝與啓用

前提:已部署 dsh,且 dsh CLI 在 PATH 中(或在 dsh 源碼 checkout 裏用 pnpm dsh …)。

1、添加插件(命令來自倉庫 README):

dsh plugin --profile web add git+https://github.com/kviiinh/dsh-whale-particles-bg.git

其他來源(README 註釋):本地路徑 dsh plugin --profile web add /abs/path/to/this/repo;若已發佈到 npm,可用 dsh plugin --profile web add dsh-whale-particles-bg。

2、重啓 Harness:

dsh web

3、在 Settings → Plugins → Plugin list → Global plugins 中應看到 whale-particles-bg 爲運行狀態,界面背後出現鯨魚粒子背景。

移除(同時去掉依賴與該層):

dsh plugin --profile web remove dsh-whale-particles-bg

也可在 profile patch 裏將對應行的 disabled: true,效果等同關閉。

典型用法與維護

日常使用

安裝並重啓後無需額外配置:本包沒有 settings namespace,也沒有 host 側業務邏輯,屬於純視覺 overlay。預覽效果可參考倉庫 README 中的動圖(src/preview.gif,720×360,10fps,約 12 秒:聚合、呼吸、指針斥力)。

dsh 大版本升級後

樹外插件攜帶 @deepseek-ai/cordis peer;若 major 升級後 peer 不匹配,需在 dsh checkout 中重新構建本包:

scripts/build.sh /path/to/deepseek-harness
# 或:DSH_CHECKOUT=/path/to/deepseek-harness scripts/build.sh

腳本會把源碼暫存到 checkout 的 packages/client/dsh-whale-particles-bg/,執行 pnpm install → tsc -b → tsdown --env.DSH_BUILD_FACE client,再把 lib/ 拷回並運行 scripts/sanitize-artifacts.mjs 脫敏構建產物中的本機路徑信息。

插件市場收錄(可選)

社區市場由 awesome-dsh-plugin registry 驅動;本倉庫已帶 dsh-plugin topic 且聲明 dsh.bundle,若 PR 進入 registry 的 UI Enhancements 分類,則可從 Settings → Plugin Market 安裝。當前以 git 安裝爲主。

適用場景與注意

適合:希望在 dsh Web 界面保留 WHALE 品牌感動效、又不想維護進程內動態 Cordis 片段的開發者;需要與官方點陣風格疊加的全屏背景時。

注意:

  • 插件以當前 dsh 進程權限運行;安裝前應自行審閱 源碼 與 MIT 許可證。
  • global.css 會全局覆蓋 body 背景;若要可配置,需自行擴展 settings 命名空間並在插件設置頁提供卡片(README 說明)。
  • 無 per-package approval 要求(無 host 側行爲),但禁用/卸載請用上述 CLI 或 patch 中的 disabled。

結尾

dsh-whale-particles-bg 把鯨魚粒子場與點陣網格註冊到 shell.overlay,安裝一條命令、重啓 dsh web 即可生效,卸載同樣一條 remove。若你在做 DSH 界面個性化,可從目錄頁與 GitHub 查看預覽與構建說明:

  • 目錄頁:https://www.skillhub.cn/plugins/kviiinh/dsh-whale-particles-bg
  • GitHub:https://github.com/kviiinh/dsh-whale-particles-bg
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜