@alexpeng/dsh-custom-plugin 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,230 @@ All notable changes to this project are documented here. The format loosely
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
5
  follow [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## 0.13.0 — 2026-12-06
8
+
9
+ #### Added
10
+
11
+ - **背景动效继续补充开源成品预设**(不新增依赖,素材均来自已有的两个
12
+ 开源项目):
13
+ - 字符档新增 `ascii-things` 的「机械」`robots` 与「机器狗」`dog`。两者使用
14
+ 与鲨群相同的墨色渲染路径,浅色 `multiply`、深色 `screen`,颜色由页面
15
+ 色板派生,两种主题都可用。
16
+ - 光影档新增 Paper Shaders 的「熔滴」`metaballs`、「晶格」`voronoi`、
17
+ 「螺旋」`spiral` 与「游丝」`neuro`。强度分别映射到球体数量、晶格缝隙、
18
+ 螺旋线宽与网状对比度。
19
+ - 面板为每个新预设提供中文名称与一句画面说明。
20
+
21
+ #### Changed
22
+
23
+ - **玻璃材质整体重做**(用户反馈「启用毛玻璃 / 液态玻璃 / 全局浮层玻璃后和没
24
+ 启动没区别」):
25
+ - 根因不是滤镜强度,而是**填充不透明**——不透明元素上的 `backdrop-filter`
26
+ 按定义不产生任何像素变化;旧的「全局浮层玻璃」只给宿主弹窗/菜单加
27
+ `backdrop-filter`,而这些表面是实色 token,所以一像素都不会变。
28
+ - 材质改为经继承变量下发:`:root` 定义毛玻璃/液态两套 `--vx-mat-*`,所有
29
+ 自有表面(浮层、对话框、通知、设置页)统一读取;毛玻璃=30px 模糊 +
30
+ 提饱和 + 单色噪点颗粒 + 顶部柔光(无方向高光),液态玻璃=清透主体 +
31
+ 逐表面位移折射 + 随指针移动的 1px 高光边 + 底部冷色厚度。
32
+ - 液态折射改为**逐表面**:按表面像素尺寸生成圆角 SDF 位移图(alpha 255,
33
+ `userSpaceOnUse` 保证倒角是固定像素厚度),单通道等距位移(不再做 RGB
34
+ 错位),中心保持干净、只有边缘折射;旧的共享 `objectBoundingBox` 滤镜会把倒角拉成
35
+ 6% 宽度,大面板上失真。
36
+ - **全局界面玻璃**(原「全局浮层玻璃」)扩展到官方设置面板、侧边栏、会话
37
+ 框架、卡片、输入框、对话框、菜单、提示与通知。宿主类名全是构建哈希,
38
+ 所以运行时按「计算背景色等于我们下发的半透明 token」识别表面,并按
39
+ surface / sidebar / panel / dialog / menu / tooltip / toast / card / input
40
+ 分配模糊预算;宿主遮罩同时补上背景模糊。
41
+ - 玻璃开启且无背景动效时,页面底部自动铺一层跟随色板的静态柔光
42
+ (`#vx-ambient`),保证玻璃始终有内容可模糊、可折射;关闭玻璃即移除。
43
+ - 实测(headless Edge,1280×822,host 形状页面):与关闭玻璃相比,插件
44
+ 浮层 Δluma 19.1(毛玻璃)/ 23.6(液态),宿主设置面板 15.5 / 22.5,
45
+ 官方设置页 8.6 / 15.6,侧边栏 4.7 / 3.1,卡片 5.6 / 4.6;深色主题
46
+ 浮层 20.0 / 33.4、设置页 9.0 / 21.2。新脚本 `pnpm bench:glass` 生成
47
+ 三张截图与逐区域指标。
48
+ - 同时修复:`--vx-mat-fill` 里引用 `--dsw-*` token 时不能在 `:root` 声明
49
+ (宿主把 token 内联在 `<body>` 上,根节点解析会静默回退成白色,深色
50
+ 主题下面板会变白板)。
51
+ - 透明表面**最多两个**同时参与位移折射且不得重叠:实测第三个会直接卡死
52
+ Chromium 合成器(截图与 rAF 同时挂起),这也符合 Apple 不叠玻璃的规则;
53
+ 其余表面保留清透填充与高光边。
54
+ - 真机(Desktop 0.2.2-rc.5,CDP)复验时修掉两个只在真实宿主上暴露的问题:
55
+ ① 第二遍扫描把「我们刚加上的 blur」误判成宿主自带材质,250ms 后把侧边栏
56
+ 与中栏面板打标撤销(引擎改为只对未打标表面做该判断);② 材质重构时浮层
57
+ 丢了 16px 圆角,液态滤镜几何退化为 `r0`(方角卡片 + 方角折射)。
58
+ - **液态二次校准(真机反馈「液态玻璃根本没生效、卡片全是雾」)**:第一版
59
+ 液态只是「更透一点的毛玻璃」,宿主表面 18–30px 模糊 + 0.34–0.50 乳白
60
+ 填充依旧糊成一片。现在液态改用「短模糊 + 强提饱和 + 高光边」:侧边栏/
61
+ 面板 12px / saturate 1.75,卡片与输入框 8px,菜单 12px;宿主填充下调
62
+ (卡片 0.26、输入框 0.36、layer-2 0.38、菜单 0.32)。高光边扩展到**所有**
63
+ 已打标表面(`data-vx-glass-rim="after"|"before"`,优先 ::after,被占用则
64
+ ::before),毛玻璃不渲染边。设置页在已打标的宿主面板内**完全去掉自身填充
65
+ 与阴影**——面板 + 设置页 + 卡片三层乳白叠加正是「设置页雾蒙蒙」的来源;
66
+ 液态下卡片改为玻璃薄片(0.2 底色 + 顶部高光 + 1px 边)。
67
+ - 真机还修掉「全屏框架吞掉所有表面」:整窗 `.frame` 被识别成无滤镜的
68
+ `surface`,而父子去重把它下面真正需要玻璃的侧边栏/中栏面板全部删除,
69
+ 会话页因此只剩框架一个标签。去重改为只由**带材质的**祖先压制后代
70
+ (`suppressesDescendants` / `dropNestedSurfaces`,含单测)。
71
+ - 液态真机证据(Desktop 0.2.2-rc.5 + CDP):侧边栏/中栏面板
72
+ `blur(12px) saturate(1.75)` + 高光边;官方设置面板
73
+ `url(#vx-lg-800x552-r28-b23) blur(14px) saturate(1.6)`、填充 0.38;设置页
74
+ 在面板内 `background: rgba(0,0,0,0)` + `backdrop-filter: none`(不叠层);
75
+ 卡片 `rgba(255,255,255,.2)` + `inset 0 1px 0 rgba(255,255,255,.8)` +
76
+ `inset 0 0 0 1px rgba(255,255,255,.4)`;账户菜单
77
+ `url(#vx-lg-144x110-r16-b9) blur(10px)`;个性化浮层
78
+ `url(#vx-lg-380x620-r16-b17)`。
79
+ - 真机证据:侧边栏 `blur(30px)`(液态 12px)、中栏面板同款并带高光边、
80
+ 官方设置面板 `url(#vx-lg-800x702-r28-b26) blur(14px)` + 遮罩
81
+ `blur(16px) saturate(1.15)`、我们的设置页在面板内 `backdrop-filter:none`
82
+ (不叠玻璃)、个性化浮层毛玻璃 `blur(30px)` + 噪点、液态
83
+ `url(#vx-lg-380x620-r16-b17)` + 高光边,圆角 16px。
84
+ - **背景动效出厂默认改为「天青灰 + 鲨群」**:`DEFAULT_CONFIG.bgFx` 从
85
+ `none` 改为 `ascii`,保留 `bg: '天青灰'`、`bgFxPreset` / `bgAsciiPreset` =
86
+ `sharks`。显式 `none` 与旧版布尔 `false` 仍然关闭;缺失字段使用新默认,
87
+ 非枚举值归 `none`,避免损坏文档误开背景层。
88
+
89
+ #### Fixed
90
+
91
+ - **去掉卡片/边缘异常泛色**(真机反馈,在满意版本上只做减法):
92
+ - 折射滤镜由「R/G/B 三通道错位 + `screen` 合成」改为**单通道等距位移**
93
+ (`feDisplacementMap` → `feGaussianBlur` → 输出)。17px 倒角下 7% 的
94
+ 通道错位会在卡片与窗口边缘产生红/青色边,看起来像「泛色」而不是玻璃;
95
+ 移除后折射仍在、颜色归零。
96
+ - 高光边 `--vx-rim-bg` 改为**纯白渐变**:去掉 45° 的青色
97
+ `rgba(180,240,255,…)` 与 315° 的粉色 `rgba(255,190,235,…)` 两站
98
+ (深色同步),窗口顶部与卡片边缘不再出现粉/青色弧线。
99
+ - 其余材质、模糊预算与布局全部保持上一版不变。
100
+ - 真机复验:设置面板/个性化浮层/额度卡的折射边缘为中性白,
101
+ 放大 6× 未见彩色描边;五道门禁全过,安装哈希与仓库构建一致。
102
+ - **「设置界面卡片 / 插件页面异常模糊」再校准**(真机反馈,承接上一条):
103
+ - 根因:设置弹层背后叠了**两层重模糊**——宿主遮罩
104
+ `--dsw-mask-blur: blur(16px)` 先把整页糊掉,面板折射链再加
105
+ `blur(14px)`;卡片以 0.42 半透明把糊过的背景透出来,所以整页与卡片
106
+ 都像雾。插件浮层的 `--vx-liquid-fill` 与内发光也偏乳白。
107
+ - 遮罩按材质分档:毛玻璃保持 `blur(16px) saturate(1.15)`,液态降为
108
+ `blur(8px) saturate(1.1)`(面板本身是清透的,不该再叠一次重模糊)。
109
+ - 折射链按面积分档:面积 > 40 万 px² 的大面板(设置弹层 800×552)用
110
+ `blur(2px)`,直接悬在正文上的小浮层(个性化卡 380×620)保留
111
+ `blur(10px)`,保证卡内文字可读、背景不穿帮。
112
+ - 液态宿主预算下调:卡片/输入框 8px→2px,提示/通知 12px→6px,
113
+ 浮层 12px→6px;侧边栏/中栏保持零模糊。
114
+ - 液态填充校准:layer-2 0.38→0.46(设置面板更实、不再透出幽灵文字),
115
+ 宿主设置卡片 token 0.24→0.40,插件设置卡片 0.2→0.58(卡片清晰不发糊,
116
+ 高光边与内描边保留玻璃薄片质感),插件液态填充径向 0.42→0.32、
117
+ 线性 0.46/0.38→0.38/0.32,大内发光 0.9/0.28→0.5/0.18(深色同步)。
118
+ - 真机证据(Desktop 0.2.2-rc.5 + CDP):设置面板
119
+ `url(#vx-lg-800x552-r28-b23) blur(2px) saturate(1.6)`、填充 0.46,
120
+ 卡片 `rgba(255,255,255,.58)`,遮罩 `blur(8px) saturate(1.1)`;
121
+ 个性化浮层 `url(#vx-lg-380x620-r16-b17) blur(10px)`,文字清晰、无雾;
122
+ 冷启动无广播即带 `vx-liquid`,侧栏/中栏 `saturate(1.35)` 零模糊。
123
+ - **「越来越糊、背景动效全被糊没了」逐层修复**(真机反馈):
124
+ - 根因一:避让正文遮罩带背景模糊。墨色字符按 8–14px 绘制,浅色 44% +
125
+ 15px、暗色墨色 40% + 14px 的遮罩会把相邻字符糊成灰色团块。真机 A/B
126
+ (Desktop 0.2.2-rc.5,CDP):28% 色罩 + 3px 仍然成团,28% + **0px**
127
+ 字符(S/%/X/@/8)逐字可辨、正文可读性不受影响。浅色改为 28% / 0px,
128
+ 暗色墨色 34% / 0px、夜色 18% / 0px、插画 40% / 3px(画笔纹理远大于
129
+ 字符,保留轻微柔化)。
130
+ - 根因二:宿主侧边栏与中栏面板的液态预算仍是 2px 模糊,两个大表面正对
131
+ 页面背景动效。液态改为**完全不模糊**(`saturate(1.35) brightness(1.01)`),
132
+ 毛玻璃保留 4px(毛玻璃本来就应柔化)。
133
+ - 根因三:冷启动时序。窗口隐藏时首轮扫描可能为空,标签不落地,`<html>`
134
+ 也拿不到 `vx-liquid`(实测冷启动 `tagged: []`)。引擎现在监听
135
+ `visibilitychange` 强制重扫,并在空结果时按 3×200ms 自愈。
136
+ - 真机复验(无任何强制广播的冷启动):`html` = `vx-light vx-glass-on
137
+ vx-liquid vx-bg-live`;侧边栏/面板 `saturate(1.35) brightness(1.01)`;
138
+ `#vx-bg-veil` = 28% / `blur(0px)`;正文后字符纹理清晰可见;个性化浮层
139
+ 仍为 `url(#vx-lg-380x620-r16-b17) blur(10px)`,设置面板仍为
140
+ `url(#vx-lg-800x552-r28-b23) blur(14px)` + 设置页透明不叠层。
141
+ - **暗色界面全面适配**:
142
+ - 背景动效开启时,浮层仍使用浅色的 `vx-bg-live` 材质,而文字已是宿主
143
+ 暗色 token,导致「个性化」浮层浅底浅字。现在补齐
144
+ `:root.vx-dark.vx-bg-live` 的毛玻璃与液态玻璃暗色配方,浮层恢复深色
145
+ 材质;设置页、对话框和通知也统一下沉。
146
+ - 浮层、对话框、通知与设置页会把当前主题写到各自所在的
147
+ `ownerDocument.documentElement`(`applyDocumentTheme` /
148
+ `useDocumentTheme`),独立窗口不再丢失 `vx-dark`。
149
+ - 调色板在暗色下改为「左浅右深」双色预览:左半是原始浅色,右半是暗色
150
+ ramp;20 个色系不再全部显示为近黑色。色块下方补充说明。
151
+ - 暗色避让正文改为分族配方:插画 44% / 20px / 28px,墨色
152
+ 40% / 14px / 24px,夜色 22% / 4px / 28px;夜色场景增加
153
+ `DARK_AMBIENT_BOOST = 1.35`,萤火虫等小光点不再被 20px 模糊吃掉;
154
+ 明亮插画的全局曝光目标由 72 提到 88,暗色下保留更多色彩。
155
+ - 实机通过 CDP 验证:暗色个性化浮层背景为
156
+ `rgba(31,33,39,.92) → rgba(24,26,31,.86)`、文字为浅色、色块为
157
+ 左浅右深;设置页、提示词编辑对话框与萤火虫背景均正常。
158
+ - **暗色避让正文改为场景同底**:暗色下遮罩不再填充页面底色,而是填充当前
159
+ 场景自身的可见底色(`--vx-veil-base`,由 `SceneBackdrop.veilBase()` 发布),
160
+ 矩形只降低局部对比,不再把明亮的插画压成深色板、也不再把它旁边的夜色
161
+ 提成灰板。明亮的插画在暗色下改为按统一目标亮度
162
+ (`DARK_SCENE_TARGET_LUMA = 72`)在画布上做全局曝光压暗
163
+ (`sceneExposure` → `brightness()`),压暗由整页一致完成,不再由矩形遮罩
164
+ 承担。暗色遮罩改为 20px 模糊、28px 羽化并取消 1.02 提亮;亮色配方保持
165
+ 不变(44% 页面底色 + 15px 模糊 + 16px 羽化),像素级不受影响。17 个场景
166
+ 中 13 个非墨色预设的底色由 headless Edge 对 `ascii-things` 1.1.1 采样写入
167
+ `SceneSpec.veilBase`,依赖升级时需重采样。
168
+ - **避让正文改为内容区矩形遮罩**:新增 `#vx-bg-veil`,它是背景层内一块
169
+ 「44% 页面底色 + 15px 背景模糊 + 轻微提亮」的矩形遮罩(浅色配方),覆盖整个中间
170
+ 内容列(含顶部空白与工具栏区域),保留背景的色相与明暗,不会变成平灰色块;
171
+ 左右侧边栏、logo 区、Windows 标题栏、底部状态栏与右侧面板保持清晰完整。
172
+ 遮罩通过 `ResizeObserver` 跟随中间内容列,侧栏开合、拖动分栏与窗口缩放时
173
+ 逐帧同步移动;唯一的 CSS 过渡是 180ms 的显示/隐藏淡入淡出,不再重建或
174
+ 闪切画布 alpha mask。原先的 `bg-focus.ts` 几何、两档渲染器的
175
+ `setFocus`/`buildFocusMask` 画布遮罩一并移除。
176
+ - 修复 Paper Shaders 噪声纹理的挂载时序:`ShaderMount` 在构造时缓存 uniform
177
+ 位置,若数据 URL 噪声图尚未解码完成,`u_noiseTexture` 会缺席且后续
178
+ `setUniforms` 无法补上,导致 `metaballs` 退化为角落里的单个球体、
179
+ `voronoi` 退化为规则方砖网格。现在在纹理完成时重挂载一次,并在监听注册
180
+ 后复查 `complete`,避免图片在两步之间完成而漏掉刷新。
181
+
182
+ ## 0.12.0 — 2026-12-04
183
+
184
+ #### Added
185
+
186
+ - **背景动效 P0 + P1 优化**(全部视觉素材来自既有两个开源项目):
187
+ - 字符档新增 5 个 `ascii-things` 夜色场景:锦鲤池 `koi`、椋鸟群
188
+ `starlings`、萤火虫 `fireflies`、城市夜景 `city`、机房 `servers`。
189
+ 它们只在深色主题渲染,浅色下临时回退「鲨群」并显示说明,已保存的选择
190
+ 不会被改写。
191
+ - 光影档新增 Paper Shaders 的 `warp`(流纹)与 `swirl`(漩涡)。
192
+ - 插画新增「单色印刷」开关(`bgLagoonInk`,默认关闭):浅色下按当前底色
193
+ 压成灰阶双色调;深色保留原作彩色(浅底插画反相后在深色页面上会变成
194
+ 大片灰雾),面板在深色下禁用该开关并说明原因。
195
+ - 预设面板按「墨色 / 插画 / 夜色 / 光影」分组,夜色组仅深色主题出现。
196
+ - 新增 `bgAsciiPreset` / `bgShaderPreset`,两个档位各自记住上次的预设,
197
+ 切换档位时恢复;旧状态由 `bgFxPreset` 自动播种。
198
+
199
+ #### Changed
200
+
201
+ - **背景动效全部重做为开源实现**:移除全部自绘字符图案(鲸鱼、水母、鱼群、海龟、
202
+ 海面)与旧的字形缓冲渲染器、粒子/波浪模拟和手写着色器。
203
+ - 字符档接入 `ascii-things`(MIT):墨色场景「鲨群」「水母」,以及彩色插画
204
+ 「礁湖」「夜礁」「海龟」「蝠鲼」「海豚」「海马」「双髻鲨」「鱼群」。
205
+ - 光影档接入 Paper Shaders(Apache-2.0):「流云」「烟岚」「光线」「网点」
206
+ 「颗粒」五套着色器。
207
+ - 墨色场景按主题从页面底色推导墨色:浅色用白底 `multiply`,深色用黑底
208
+ `screen`,页面色调不因动效改变;插画保持原作色彩,以预设浓度叠在底色上。
209
+ - 避让正文改为 CSS `mask-image`(1/4 分辨率、150 px 羽化、0.15 地板),
210
+ 两档共用同一几何;关掉开关时不再生成遮罩。
211
+ - 面板参数随渲染器收敛:字符档密度 / 速度 / 浓度,光影档速度 / 强度 / 浓度;
212
+ `bgFxPreset` 默认值变为 `sharks`(字符)与 `mesh`(光影),旧 id 自动迁移。
213
+ - 光影档改为 WebGL2 门禁,不支持时回退字符档并提示;两档共用页面层、
214
+ 主题色板与「避让正文」契约。
215
+ - NOTICE 增加 `ascii-things` 与 Paper Shaders 的许可证归属。
216
+ - 背景渲染分辨率跟随设备像素比并设上限:光影档 `resolveShaderDpr`(1..2)
217
+ + 400 万像素上限,字符档 ink 2×、插画与夜色 1.5×;不再固定 2× 渲染。
218
+ - 字符档拖动滑杆时只下发变化的 `speed/columns` 补丁,墨色调色板仅在墨色
219
+ 强度真正变化时重算;`data-vx-bg-motion` 现在也会暂停/恢复字符场景。
220
+ - 深色墨色场景 alpha ×0.8,椋鸟群默认浓度提高到 0.85,降低深色下的块状感。
221
+ - 性能实测(headless Edge,1280×822 与 1920×1080,DPR 1):15 个场景与
222
+ 7 个着色器均保持 240 Hz vsync、无超过 33 ms 的帧;未触发放宽
223
+ `maxDpr` / `SHADER_MAX_PIXELS` 的降级规则。
224
+
225
+ #### Fixed
226
+
227
+ - 光影档 WebGL2 上下文丢失时不再停在失效画布上:`attachContextLoss` 阻止
228
+ 浏览器自动恢复,只回调一次 `onFallback`,设置 `bgFxShaderBlocked` 后回退
229
+ 字符档并提示一次。
230
+
7
231
  ## 0.11.0 — 2026-12-03
8
232
 
9
233
  #### Added
package/NOTICE CHANGED
@@ -1,52 +1,18 @@
1
1
  dsh-custom-plugin
2
2
  =================
3
3
 
4
- The ocean background piece (`src/client/bg-ocean.ts`) derives its
5
- divergence-free current form and its boids-lite school steering from
6
- `stackedlol/ascii-sharks`:
4
+ The character-tier background scenes are rendered with `ascii-things`
5
+ (https://github.com/chuma-beep/ascii-things), bundled unmodified:
7
6
 
8
7
  MIT License
9
- Copyright (c) 2026 drewdi
10
8
 
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
9
+ Copyright (c) 2026 ascii-things contributors
17
10
 
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
-
29
- The wave tank (`src/client/bg-wake.ts`) is original to this package.
30
-
31
- The `dsh-ascii-ocean` plugin was read as a behaviour reference only. Its
32
- repository has no licence text (the LICENSE file is 12 bytes), so no code from
33
- it is copied here.
34
-
35
- The shape-aware glyph chart in `src/client/bg-ascii.ts` (`SHAPE_EXTRAS`,
36
- `buildShapeChart` and the `level × 5 + direction` lookup) adapts the algorithm
37
- described in Alex Harri Jónsson's "ASCII characters are not pixels" and the MIT
38
- `glyph-graphics` implementation:
39
-
40
- MIT License
41
-
42
- Copyright (c) 2026 Alex Yankov
43
-
44
- This library implements the ASCII rendering algorithm described in
45
- "Rendering ASCII in WebGL" by Alex Harri Jónsson
46
- (https://alexharri.com/blog/ascii-rendering) and is derived from the
47
- MIT-licensed implementation in https://github.com/alexharri/website:
48
-
49
- Copyright (c) 2025 Alex Harri Jónsson
11
+ This project is derived from ascii-sharks by stackedlol
12
+ (https://github.com/stackedlol/ascii-sharks). The original shark simulation
13
+ and procedural ASCII rendering are by the original author. ascii-things
14
+ adds the library API, packaging, palettes, seeded worlds, accessibility
15
+ options, framework adapters, and the robot scene.
50
16
 
51
17
  Permission is hereby granted, free of charge, to any person obtaining a copy
52
18
  of this software and associated documentation files (the "Software"), to deal
@@ -66,6 +32,30 @@ described in Alex Harri Jónsson's "ASCII characters are not pixels" and the MIT
66
32
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
67
33
  SOFTWARE.
68
34
 
69
- No source files are vendored: the renderer applies the idea to its own
70
- level-buffer + atlas pipeline.
71
-
35
+ The light/shadow tier is rendered with Paper Shaders
36
+ (https://github.com/paper-design/shaders), Apache-2.0. This package's own
37
+ LICENSE carries the Apache License 2.0 text; the upstream NOTICE is reproduced
38
+ verbatim:
39
+
40
+ Paper Shaders
41
+ Copyright 2026 Paper
42
+
43
+ Powered by Paper Shaders:
44
+ https://shaders.paper.design
45
+
46
+ The liquid-glass displacement filter is an original implementation inspired by
47
+ two MIT-licensed community projects, with no source code vendored and no new
48
+ dependency:
49
+
50
+ - shuding/liquid-glass (https://github.com/shuding/liquid-glass, MIT): the
51
+ rounded-rect signed-distance displacement map written at alpha 255, because
52
+ Chromium premultiplies transparent PNGs and turns the map into zeros.
53
+ - rdev/liquid-glass-react (https://github.com/rdev/liquid-glass-react, MIT):
54
+ the per-surface displacement-lens approach. The community project's three-pass
55
+ RGB channel recombination was tried and then removed, because on live card
56
+ edges it read as a coloured fringe; the shipped filter is one achromatic
57
+ displacement pass.
58
+
59
+ Both are credited for the technique; the geometry, per-surface sizing, channel
60
+ gains, fallback chain and host-surface discovery in `src/client/glass/` are this
61
+ project's own work.
package/README.i18n.yaml CHANGED
@@ -3,5 +3,5 @@
3
3
  # after editing either side, bring the other along and re-record the hashes:
4
4
  # git hash-object --path README.md README.md
5
5
  # git hash-object --path README.zh.md README.zh.md
6
- README.md: 3ab2507bf773013e792d3869f730e8718f250d17
7
- README.zh.md: 74f9119d30b6bf25402bf44f2649b41e3ec43571
6
+ README.md: 7fcfc3b1c43b18762c35a69650862b548316812d
7
+ README.zh.md: f57a92fcbe74d5658b6c4acf9c091abfbe2da081
package/README.md CHANGED
@@ -29,7 +29,7 @@ The plugin is dual-face: the host half (`src/`) owns the state document, registe
29
29
  <td width="50%" valign="top"><b>The same panel as a popover from the session header (light theme)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/personalization-panel.png" alt="Personalization popover" width="100%"></td>
30
30
  </tr>
31
31
  <tr>
32
- <td width="50%" valign="top"><b>Liquid glass (displacement refraction on Custom surfaces)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="Liquid glass" width="100%"></td>
32
+ <td width="50%" valign="top"><b>Liquid glass (per-surface displacement refraction, applied app-wide)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="Liquid glass" width="100%"></td>
33
33
  <td width="50%" valign="top"><b>Multi-level project folders</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="Project folders" width="100%"></td>
34
34
  </tr>
35
35
  <tr>
@@ -51,11 +51,11 @@ Weather FX is shown in dark mode. Usage history, backup-import previews, session
51
51
 
52
52
  ### Appearance
53
53
 
54
- - **Background colors**: 20 muted low-saturation palettes (each with a matching tab color, `天青灰` by default) plus "no color" (follows the GUI default theme). Every palette works in both themes; dark mode derives the same family's dark variant (hue and low saturation kept, lightness dropped onto the dark ramp), and the swatch preview shows what the current theme will actually paint.
54
+ - **Background colors**: 20 muted low-saturation palettes (each with a matching tab color, `天青灰` by default) plus "no color" (follows the GUI default theme). Every palette works in both themes; dark mode derives the same family's dark variant (hue and low saturation kept, lightness dropped onto the dark ramp), and each swatch previews both halves — the light family on the left and its dark ramp on the right — so the dark variants never collapse into a row of black tiles.
55
55
  - **Weather FX**: canvas-rendered, pointer-transparent one-click overlays — falling snow, cinematic rain (three depth layers with splashes), and drifting sakura petals; turning it off clears the canvas.
56
- - **Glass**: frosted glass on every Custom surface, or liquid glass (a rounded-rect SDF displacement map refracts all four edges, with a restrained blur + saturation, a 1px specular rim and the host fill at ~70% so text over large panels stays readable; engines without SVG-referencing backdrop filters fall back to frosted). When a background renderer is live, the glass switches to a centre-solid / edge-clear radial fill and a contrast-boosted backdrop so the animation stays visible at the rim without hurting the copy. A global-glass option extends the same treatment to dialogs, menus, tooltips, listboxes and the system settings window — displaced as well in liquid mode.
56
+ - **Glass**: two real materials instead of a near-white translucent pane. Frost is a matte acrylic sheet — a 30px blur, a saturation lift, a monochrome noise grain and a soft top light, with no directional specular. Liquid glass follows Apple's Liquid Glass: a per-surface rounded-rect SDF displacement map with a single achromatic displacement pass, so only the rim refracts while the middle stays clean, plus a white 1px specular rim whose highlight follows the pointer. Both stay translucent — an opaque fill disables the backdrop filter entirely, which is exactly why turning glass on used to change nothing. With 背景动效 off the plugin lays a faint static colour field under the page (following the active palette), so the glass always has something to blur and refract; with a renderer live the animation itself shows through. 全局界面玻璃 extends the same material to the official settings panel, sidebar, session frame, cards, inputs, dialogs, menus, tooltips and toasts: host surfaces are recognised at runtime by their computed background matching the translucent tokens we installed (host class names are build hashes, so no selector can target them), each kind gets its own blur budget, and in liquid mode dialogs and menus also get their own per-surface refraction. Host masks gain a backdrop blur as well. At most two translucent surfaces refract at once (a third stalls Chromium's compositor outright, and Apple's guidance is no glass on glass); the rest keep the clear fill and specular rim.
57
57
  - **Native surfaces**: the header's 个性化 button opens only a compact appearance popover anchored to it — flipped upward when the viewport runs short, never a draggable window — while folders, prompts, search, export, Mermaid, efficiency, usage and data management all live in the 个性化 section of DSH Settings. Popovers, menus and settings cards use the host's menu material, elevation shadows, radius scale and type scale, with 150–220 ms open/close motion that starts from the anchor's edge (toasts also animate out in place) and respects the system's reduced-motion preference.
58
- - **Background motion**: a full-page animated layer beneath the content, in two independent tiers — ASCII glyph grids (`flow`, `rain`, `ocean`, `whale`, `jelly`, `starfield`, `ripple`, plus the zero-animation `static`) and 光影 (the shader tier: one full-screen WebGL1 shader per style, `liquid`, `grain`; a page without WebGL falls back to the ASCII tier and says so). The panel switches tier and preset, tunes density, speed, frame rate, font size and opacity — intensity instead of font/opacity on the shader tier — and "restore defaults" resets only those six parameter overrides back to "follow the current preset"; the tier and preset themselves are never changed by that button, and the panel says so next to it. Every slider clamps to the active preset's declared range. Ink strength is a separate three-step choice (柔和 / 标准 / 强烈) that scales the ink step without touching density, speed or frame rate, and the **avoid-the-copy** switch (避让正文, on by default) fades the texture behind the reading column while the page edges keep full strength — turning it off makes the whole page uniform. While the effect is on, the shell's page fills become translucent so the texture shows; with glass on, cards and popovers become glass over that texture — the centre keeps enough tint for the copy while the edges reveal the animation — and dialogs stay opaque. `ocean`, `flow`, `rain`, `ripple`, `starfield`, `whale` and `jelly` respond to the pointer. The `ocean` preset lives inside the conversation column, so the water is visible behind the messages; drag to leave ripples, click for a splash, and the fish school scatters and regroups. `whale` is the one preset whose subject is a picture: a glyph-built whale crosses the page, spouts above its head every few seconds and leaves a bubble trail; the pointer makes it speed up and bank away, and a click startles it into a tail beat and a spout. `jelly` raises a jellyfish from the bottom of the page: the bell pulses open and closed, the tendrils trail in the water, the pointer makes it rise faster and contract, and a click lights a small ring of plankton sparks. `flow` stays a page-level background, but the pointer now stirs its fog: dragging bends and thickens the noise along the path, and a click pushes a ring through it. `rain` reads the pointer as wind: a flick slants the falling trails and a click parts the curtain to both sides, then it slowly closes again. In `ripple`, a click drops a new ring where it lands and a drag leaves a trail of small ones. `starfield` keeps its sparse character — a press lights a small burst of stars and a drag scatters a thin trail, both fading out in about a second. The shader tier's `liquid` also follows the pointer: moving it twists the ink cloud and a click sends a ring outward, while `grain` stays a static speck field by design. The other presets are still page-level backgrounds.
58
+ - **Background motion**: a full-page animated layer beneath the content, built entirely from open-source renderers. The 字符 tier mounts `ascii-things` scenes in three groups — ink `sharks` / `jellyfish` / `robots` / `dog`, full-colour lagoon paintings `reef`, `night`, `turtle`, `manta`, `dolphin`, `seahorse`, `hammerhead`, `tang`, and five night scenes `koi`, `starlings`, `fireflies`, `city`, `servers`. Night scenes render only in dark mode; light mode temporarily shows `sharks` with a note and never changes the stored choice. 单色印刷 turns a lagoon into a page-tint duotone in light mode; dark mode keeps the painting's own colours (globally dimmed to a dark-page exposure), because inverting light-background art behind a dark page reads as a grey wash. The 光影 tier mounts Paper Shaders fields `mesh`, `smoke`, `rays`, `dither`, `grain`, `warp`, `swirl`, `metaballs`, `voronoi`, `spiral` and `neuro`. The panel groups presets, and each tier remembers its own last preset when you switch between them. It tunes density, speed and opacity on ink scenes, speed and opacity on painted and night scenes, and speed, intensity and opacity on the shader tier, and "restore defaults" resets only those parameter overrides — the tier and the preset themselves never move. Every slider clamps to the active preset's declared range. Ink strength is a separate three-step choice (柔和 / 标准 / 强烈) that scales the ink step without touching density or speed, and the **avoid-the-copy** switch (避让正文, on by default) covers the whole centre column with a rectangular veil — header, hero and blank top included. Light mode fills it with the page tint at 28% with no backdrop blur; dark mode fills it with the scene's own visible base using a per-family recipe — lagoon 40% / 3px / 28px, ink 34% / 0px / 24px, ambient 18% / 0px / 28px — and dims bright lagoon paintings globally to a dark-page exposure (fireflies and the other night scenes get a lift instead) so the rectangle only lowers local contrast. The content keeps the scene's hue instead of turning grey, while the left/right sidebars, logo band and right panel stay sharp. A `ResizeObserver` tracks the centre column, so the veil moves in lockstep with sidebar open/close and column drags instead of chasing a tween. Both tiers pause while the page is hidden, honour reduced motion and are destroyed on unmount; render resolution follows the device pixel ratio under a cap (painted scenes 1.5×, shaders 4M pixels). The shader tier needs WebGL2 and falls back to the character tier with one notice when it is unavailable or loses its context. The scene catalogue and the shader fields come from `ascii-things` (MIT) and Paper Shaders (Apache-2.0); see NOTICE.
59
59
 
60
60
  <img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/background-motion-panel.png" alt="Background motion panel with the character tier active" width="360">
61
61
 
@@ -233,15 +233,18 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
233
233
  | Key | Default | Meaning |
234
234
  |---|---|---|
235
235
  | `bg` | `天青灰` | `default` (no color) / one of the 20 palette names (both themes; a stored `aurora` migrates to `default`) |
236
- | `bgFx` | `none` | `none` / `ascii` / `shader` (labelled 关闭 / 字符 / 光影 in the panel); the shader tier falls back to ASCII when the page has no WebGL |
237
- | `bgFxPreset` | `flow` | the active tier's preset: `flow`/`rain`/`ocean`/`whale`/`jelly`/`starfield`/`ripple`/`static` for ASCII, `liquid`/`grain` for the shader tier; an id from the other tier resets to that tier's default |
236
+ | `bgFx` | `ascii` | `none` / `ascii` / `shader` (labelled 关闭 / 字符 / 光影 in the panel); the factory default is the 天青灰 + 鲨群 pair, and `none` turns the layer off; the shader tier needs WebGL2 and falls back to the character tier when it is unavailable |
237
+ | `bgFxPreset` | `sharks` | the active tier's preset: `sharks`/`jellyfish`/`robots`/`dog`/`reef`/`night`/`turtle`/`manta`/`dolphin`/`seahorse`/`hammerhead`/`tang`/`koi`/`starlings`/`fireflies`/`city`/`servers` for the character tier, `mesh`/`smoke`/`rays`/`dither`/`grain`/`warp`/`swirl`/`metaballs`/`voronoi`/`spiral`/`neuro` for the shader tier; an id from the other tier resets to that tier's remembered preset |
238
+ | `bgAsciiPreset` | `sharks` | last character-tier scene, restored when switching back to 字符 |
239
+ | `bgShaderPreset` | `mesh` | last shader-tier style, restored when switching back to 光影 |
240
+ | `bgLagoonInk` | `false` | 单色印刷 for lagoon paintings: page-tint duotone in light mode; dark mode keeps the authored colour |
238
241
  | `bgStrength` | `standard` | ink strength `soft` / `standard` / `strong` (柔和 / 标准 / 强烈), multipliers 0.45 / 0.62 / 0.9; scales the ink step only, density/speed/frame rate are unaffected. `standard` is the shipped default and matches the depth the earlier build used for 柔和 |
239
- | `bgFocus` | `true` | 避让正文: fade the texture behind the reading column and keep the page edges dense; `false` makes the whole page uniform and takes the mask out of the render pipeline |
240
- | `bgDensity`, `bgSpeed`, `bgFps`, `bgFontPx`, `bgOpacity`, `bgIntensity` | `-1` | panel overrides; `-1` follows the preset, anything else is clamped to the active preset's declared range (ASCII uses five, shader uses density/speed/fps/intensity) |
242
+ | `bgFocus` | `true` | 避让正文: cover the whole centre column (header and blank top included) with a rectangular veil; light mode uses the page tint at 44% + 15px blur + a slight brightness lift, dark mode uses the scene's own visible base with a per-family recipe (lagoon 44% + 20px, ink 40% + 14px, ambient 22% + 4px, all with a 28px feather), so the rectangle only lowers local contrast; bright lagoons are dimmed globally and ambient scenes lifted for dark mode, and the sidebars, logo band and right panel stay sharp; a `ResizeObserver` keeps the veil in lockstep with column moves; `false` hides it and makes the page uniform |
243
+ | `bgDensity`, `bgSpeed`, `bgFps`, `bgFontPx`, `bgOpacity`, `bgIntensity` | `-1` | panel overrides; `-1` follows the preset, anything else is clamped to the active preset's declared range (the character tier uses density/speed/opacity, the shader tier speed/intensity/opacity) |
241
244
  | `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
242
- | `glass` | `true` | master glass toggle for Custom surfaces |
243
- | `glassMode` | `frost` | `frost` frosted / `liquid` displacement glass |
244
- | `globalGlass` | `true` | blur global overlays (dialogs/menus/tooltips) |
245
+ | `glass` | `true` | master glass toggle (also enables the static colour field under the page) |
246
+ | `glassMode` | `frost` | `frost` matte acrylic / `liquid` Apple-style displacement glass |
247
+ | `globalGlass` | `true` | apply the same material to the official settings sheet, sidebar, cards, inputs, dialogs, menus, tooltips and toasts |
245
248
  | `antiScroll` | `false` | anti auto-scroll |
246
249
  | `mermaid` | `true` | automatic in-place Mermaid rendering (plus render chips) |
247
250
  | `formula` | `true` | LaTeX / MathML copy chips |
package/README.zh.md CHANGED
@@ -29,7 +29,7 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
29
29
  <td width="50%" valign="top"><b>会话头部弹出的同一套面板(浅色主题)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/personalization-panel.png" alt="个性化弹窗面板" width="100%"></td>
30
30
  </tr>
31
31
  <tr>
32
- <td width="50%" valign="top"><b>液态玻璃(Custom 面板位移折射)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="液态玻璃" width="100%"></td>
32
+ <td width="50%" valign="top"><b>液态玻璃(逐表面位移折射,全界面材质)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="液态玻璃" width="100%"></td>
33
33
  <td width="50%" valign="top"><b>多级项目文件夹</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="项目文件夹" width="100%"></td>
34
34
  </tr>
35
35
  <tr>
@@ -51,11 +51,11 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
51
51
 
52
52
  ### 外观个性化
53
53
 
54
- - **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI 默认主题)。深浅色模式均可选用;深色模式自动派生同色系的深色变体(保留色相与低饱和,落到深色明度档),色板预览即当前模式的实际效果。
54
+ - **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI 默认主题)。深浅色模式均可选用;深色模式自动派生同色系的深色变体(保留色相与低饱和,落到深色明度档)。色块改为「左浅右深」双色预览:左半是原始浅色家族,右半是暗色派生值,暗色下不再是一排黑块。
55
55
  - **天气特效**:画布渲染、不挡交互,一键切换——飘雪、电影感雨滴(三层景深 + 地面溅起)、樱花飘落;关闭时自动清空画布。
56
- - **玻璃效果**:所有 Custom 面板默认毛玻璃;可切换液态玻璃(圆角矩形 SDF 位移贴图让四条边对称折射,配合克制的模糊提饱和、1px 高光边与约 70% 宿主填充,大面积面板文字仍清晰;不支持 SVG 位移滤镜的引擎自动回退毛玻璃)。背景动效开启时,玻璃改用「中心实、边缘透」的径向填充与提高对比度的滤镜链,让动画纹理在玻璃边缘继续可见,同时保持正文可读。「全局浮层玻璃」对弹窗、菜单、提示框、下拉框与系统设置窗统一加玻璃质感,液态模式下浮层同样位移折射。
56
+ - **玻璃效果**:两套真材质,不再是「近白半透明」。毛玻璃=乳白哑光(30px 模糊 + 提饱和 + 单色噪点颗粒 + 顶部柔光,无方向性高光);液态玻璃=Apple Liquid Glass 式清透材质(逐表面圆角 SDF 位移图,单通道、无色散,只在边缘折射、中心保持干净,纯白 1px 高光边随鼠标指针移动)。两种材质都保持半透明:不透明填充会让背景滤镜完全失效,这正是之前「开不开一样」的根因。开关玻璃且没有背景动效时,页面底部自动铺一层跟随当前色板的极淡静态柔光,玻璃始终有内容可模糊、可折射;有背景动效时直接透出动画纹理。「全局界面玻璃」把同一套材质扩展到官方设置面板、侧边栏、会话框架、卡片、输入框、对话框、菜单、提示与通知:运行时按「计算背景色等于我们下发的半透明 token」识别宿主表面(宿主类名是构建哈希,不能写选择器),按表面类型分配模糊预算,液态模式下弹窗与菜单额外获得逐表面折射;同时给宿主遮罩补上背景模糊。透明表面最多同时两个参与折射(Chromium 上第三个会直接卡死合成器,这也符合 Apple 不叠玻璃的规则),其余保留清透填充与高光边。
57
57
  - **原生入口**:头部「个性化」按钮只打开一个紧凑的外观浮层,锚定在按钮下方、空间不足时自动上翻,不再有可拖拽窗口;项目、提示词、搜索、导出、Mermaid、效率、额度与数据管理全部收进 dsh 设置页的「个性化」分区。浮层、菜单与设置卡片统一使用宿主菜单材质、抬升阴影、圆角与字号阶梯,开合有 150–220ms 的淡入/缩放动效(浮层从锚定方向进入),通知在原位退出,并遵循系统的「减少动态效果」设置。
58
- - **背景动效**:内容层下方的整页动态背景,两套互斥档位——字符档(`flow` / `rain` / `ocean` / `whale` / `jelly` / `starfield` / `ripple`,以及零动画的 `static`)与光影档(每套风格一张全屏着色器:`liquid` / `grain`;页面不支持 WebGL 时回退字符档并提示)。面板里切换档位与预设,可调密度、速度、帧率、字号与浓度(光影档为强度,字号/浓度不适用),「恢复默认参数」只把六项参数恢复为「跟随预设」,不改变动效档位与预设(按钮旁与提示里都写明了这一点);滑块值一律 clamp 到当前预设声明的范围。墨色强度是另一条独立的轴(柔和 / 标准 / 强烈),只改墨色深浅、不动密度、速度与帧率;「避让正文」开关默认打开,让正文读取列更淡、页面四周保持浓淡,关掉则整页均匀。动效开启时页面底色会调成半透明以便透出纹理;开启玻璃后卡片和浮层会变成覆盖在这层纹理上的玻璃——中心保留足够填充保证可读,边缘透出持续运动的动画,对话框保持不透明。`ocean`、`flow`、`rain`、`ripple`、`starfield`、`whale` 与 `jelly` 都能响应鼠标。`ocean` 铺在会话中栏内部,水面直接出现在消息背后:拖动会留下涟漪,点击溅起水花,鱼群会惊散后重新聚拢。`whale` 是一条由字符画成的鲸鱼横游整页:指针靠近会让它游快并向另一侧让开,点击会让它摆尾喷水;它自己每隔一阵也会在头顶喷一道水柱,尾巴后面跟着气泡。`jelly` 是一只从页面下方缓缓升起的水母:伞盖随脉动一开一合、触手随水飘动,鼠标靠近会游得更快并收伞,点击会在落点亮起一小圈浮游微光。`flow` 仍是整页背景,但指针现在会搅动雾面:拖动沿途扭曲并加浓噪声,点击推开一圈涟漪。`rain` 把指针当作风:划过会把雨丝吹斜,点击向两侧拨开雨帘,随后慢慢合拢。`ripple` 的点击会在落点漾开一圈新涟漪,拖动沿途留下小水纹。`starfield` 保持稀疏:点击点亮一小片星尘,拖动撒下一条淡淡星光,两者约一秒后暗去。光影档的 `liquid` 也会跟随鼠标:划过会卷动墨云,点击从落点扩散出一圈涟漪;`grain` 按设计保持静态噪点。其余预设仍是整页背景。
58
+ - **背景动效**:内容层下方的整页动态背景,全部由开源渲染器承担。字符档挂载 `ascii-things` 场景,分为三组:墨色 `sharks`、`jellyfish`、`robots`、`dog`,整幅彩色插画 `reef`、`night`、`turtle`、`manta`、`dolphin`、`seahorse`、`hammerhead`、`tang`,以及夜色 `koi`、`starlings`、`fireflies`、`city`、`servers`。夜色场景只在深色主题渲染;浅色下临时显示 `sharks` 并给出说明,不改变已保存的选择。「单色印刷」仅在浅色下把插画压成当前底色的双色调;深色保留原作彩色(按统一的暗色目标亮度全局压暗),因为把浅底插画反相放到深色页面上会呈现大片灰雾。光影档挂载 Paper Shaders 的 `mesh`、`smoke`、`rays`、`dither`、`grain`、`warp`、`swirl`、`metaballs`、`voronoi`、`spiral`、`neuro`。面板按组展示预设,两个档位各自记住上次的预设,切换档位时恢复。墨色场景可调密度、速度与浓度,插画与夜色场景可调速度与浓度,光影档可调速度、强度与浓度;「恢复默认参数」只恢复这些参数覆盖值,不改变档位与预设。所有滑块值一律 clamp 到当前预设声明的范围。墨色强度是另一条独立的轴(柔和 / 标准 / 强烈),只改墨色深浅、不动密度与速度;「避让正文」默认打开:在中间内容列上覆盖一层矩形遮罩(含顶部空白与工具栏区域)。浅色模式下它是「28% 页面底色、不叠加背景模糊」;深色模式下改为按场景族设置配方的「当前场景自身可见底色」遮罩:插画 40% / 3px / 28px,墨色 34% / 0px / 24px,夜色 18% / 0px / 28px;明亮的插画做全局曝光压暗,萤火虫等夜色场景则做亮度提升,矩形只降低局部对比,不压黑或提亮画面。这样矩形只降低局部对比、不改变画面明暗,左右侧边栏、logo 区与右侧面板保持清晰完整。遮罩通过 `ResizeObserver` 跟随中间列逐帧变化,开合侧栏、拖动分栏时与布局同步移动。两档都会在页面隐藏时暂停、遵循系统「减少动态效果」,并在卸载时销毁;渲染分辨率跟随设备像素比并设上限(插画 1.5×、光影 400 万像素)。光影档需要 WebGL2,不可用或上下文丢失时会回退字符档并提示一次。场景目录与光影着色器分别来自 `ascii-things`(MIT)与 Paper Shaders(Apache-2.0),归属见 NOTICE。
59
59
 
60
60
  <img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/background-motion-panel.png" alt="背景动效面板(字符档)" width="360">
61
61
 
@@ -216,15 +216,18 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
216
216
  | 配置项 | 默认值 | 说明 |
217
217
  |---|---|---|
218
218
  | `bg` | `天青灰` | `default`(无颜色)/ 20 组调色板名之一(深浅色通用;旧存档的 `aurora` 自动迁移为 `default`) |
219
- | `bgFx` | `none` | `none` / `ascii` / `shader`(面板上的「关闭 / 字符 / 光影」);光影档在不支持 WebGL 的页面回退字符档 |
220
- | `bgFxPreset` | `flow` | 当前档位的预设:字符档 `flow`/`rain`/`ocean`/`whale`/`jelly`/`starfield`/`ripple`/`static`,光影档 `liquid`/`grain`;另一档的 id 会重置为该档默认值 |
219
+ | `bgFx` | `ascii` | `none` / `ascii` / `shader`(面板上的「关闭 / 字符 / 光影」);出厂默认为「天青灰 + 鲨群」,选 `none` 关闭背景层;光影档需要 WebGL2,不可用时回退字符档 |
220
+ | `bgFxPreset` | `sharks` | 当前档位的预设:字符档 `sharks`/`jellyfish`/`robots`/`dog`/`reef`/`night`/`turtle`/`manta`/`dolphin`/`seahorse`/`hammerhead`/`tang`/`koi`/`starlings`/`fireflies`/`city`/`servers`,光影档 `mesh`/`smoke`/`rays`/`dither`/`grain`/`warp`/`swirl`/`metaballs`/`voronoi`/`spiral`/`neuro`;另一档的 id 会回落到该档记住的预设 |
221
+ | `bgAsciiPreset` | `sharks` | 字符档上次的场景,切回字符档时恢复 |
222
+ | `bgShaderPreset` | `mesh` | 光影档上次的样式,切回光影档时恢复 |
223
+ | `bgLagoonInk` | `false` | 插画的「单色印刷」:浅色下用当前底色做双色调;深色保留原作彩色 |
221
224
  | `bgStrength` | `standard` | 墨色强度 `soft` / `standard` / `strong`(柔和 / 标准 / 强烈),倍率 0.45 / 0.62 / 0.9;只缩放墨色阶,密度/速度/帧率不受影响。默认「标准」,深度与此前版本的「柔和」一致 |
222
- | `bgFocus` | `true` | 避让正文:正文读取列更淡、页面四周保持浓淡;`false` 时整页均匀,遮罩完全退出渲染管线 |
223
- | `bgDensity`、`bgSpeed`、`bgFps`、`bgFontPx`、`bgOpacity`、`bgIntensity` | `-1` | 面板覆盖值;`-1` 表示跟随预设,其余值一律 clamp 到当前预设声明的范围(字符档用五项,光影档用密度/速度/帧率/强度) |
225
+ | `bgFocus` | `true` | 避让正文:在中间内容列(含顶部空白)上覆盖矩形遮罩;浅色用 44% 页面底色 + 15px 模糊 + 轻微提亮,深色按场景族用当前场景自身可见底色:插画 44% + 20px、墨色 40% + 14px、夜色 22% + 4px,均 28px 羽化;矩形只降低局部对比,明亮插画全局压暗、夜色场景适度提亮;左右侧边栏、logo 区与右侧面板保持清晰;`ResizeObserver` 让遮罩逐帧跟随内容列;`false` 时整页均匀,遮罩隐藏 |
226
+ | `bgDensity`、`bgSpeed`、`bgFps`、`bgFontPx`、`bgOpacity`、`bgIntensity` | `-1` | 面板覆盖值;`-1` 表示跟随预设,其余值一律 clamp 到当前预设声明的范围(字符档用密度/速度/浓度,光影档用速度/强度/浓度) |
224
227
  | `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
225
- | `glass` | `true` | Custom 面板玻璃总开关 |
228
+ | `glass` | `true` | 玻璃总开关(同时决定是否铺静态柔光底层) |
226
229
  | `glassMode` | `frost` | `frost` 毛玻璃 / `liquid` 液态玻璃 |
227
- | `globalGlass` | `true` | 全局浮层(弹窗/菜单/提示)加模糊 |
230
+ | `globalGlass` | `true` | 全局界面玻璃:官方设置、侧边栏、卡片、输入框、对话框、菜单、提示与通知一并应用同一材质 |
228
231
  | `antiScroll` | `false` | 防自动跳底 |
229
232
  | `mermaid` | `true` | Mermaid 图表自动就地渲染(含消息下方渲染按钮) |
230
233
  | `formula` | `true` | LaTeX / MathML 复制按钮 |