@sparkelf/dsh-right-bg-anim 0.0.0-stage → 1.1.1

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/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SparkElf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ The fluid simulation, elastic grid and their motion parameters are derived from
26
+ dsh-official-homepage-theme (https://github.com/JohnnyTing/dsh-official-homepage-theme),
27
+ MIT licensed, Copyright (c) JohnnyTing.
package/README.md CHANGED
@@ -1,3 +1,94 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # dsh-right-bg-anim
2
+
3
+ > 由 SparkElf 作为 DSH Plus 自有插件维护,源码位于 [deepseek-harness-plus](https://github.com/SparkElf/deepseek-harness-plus) 的 `downstream/packages/plugins/dsh-right-bg-anim`。
4
+
5
+ DSH 装饰插件:**只在新会话的主内容区(侧边栏右侧)叠加一层透明流体动画**,其余界面全部保持官方原样。
6
+
7
+ ## 效果
8
+
9
+ - **流体薄膜**:WebGL2 实时流体,随鼠标方向、速度产生水波、卷曲与渐进恢复。
10
+ - **弹性网格**:鼠标靠近时推开节点、拉伸连线,静止后自动休眠。
11
+ - **明暗双主题**:跟随宿主 `body[data-ds-dark-theme]`,切换主题即时重算配色,无需刷新。
12
+ - **只在新建会话显示**:进入已有对话后自动隐藏,官方背景原样恢复。
13
+
14
+ ## 两种合成模式(设置页可切换)
15
+
16
+ | 模式 | 做法 | 观感 |
17
+ | --- | --- | --- |
18
+ | **玻璃薄膜**(默认) | 半透明着色薄片叠加在背景上,官方底色仍占主导 | 玻璃质感、可见度可调 |
19
+ | **调制雾感** | 自身不带颜色,用 `mix-blend-mode: soft-light` 只调制背景明暗 | 雾气拂过页面 |
20
+
21
+ > 实测约束:`soft-light` 在**两个极端底色上都不响应**——官方深色底 `#151517` 上中灰仅移动约 1.6/255,纯白底 `#ffffff` 上几乎为 0。所以单一混合模式无法同时服务两套主题:深色底用 `soft-light` **提亮**(0xD8 ≈ +19.9),浅色底改用 `multiply` **压暗**(0x60 ≈ −127),色阶随之取反。这是本插件显式处理的适配点。
22
+
23
+ ## 设置项
24
+
25
+ 设置 → 通用 → **新会话背景动画**:
26
+
27
+ - 启用开关
28
+ - 效果模式:玻璃薄膜 / 调制雾感
29
+ - 明显程度:玻璃模式=薄膜不透明度;调制模式=雾感强度
30
+ - 网格强度:0–3
31
+ - 流动速度:0.2–3
32
+
33
+ **参数按「模式 × 主题」分别记忆**。两种模式所需的量级相差一个数量级(玻璃约 0.04 就够,调制在深色底需要约 0.48 才可见),共用一个值会在切换时错位,因此:
34
+
35
+ - 切换模式 → 落到该模式上次用过的值(首次即该模式默认值);
36
+ - 切换明暗主题 → 各自保留,互不覆盖。
37
+
38
+ 默认值:
39
+
40
+ | 模式 | 深色 | 浅色 |
41
+ | --- | --- | --- |
42
+ | 玻璃薄膜 | 0.04 | 0.04 |
43
+ | 调制雾感 | **0.48** | 0.1 |
44
+ | 网格强度 | 1 | 1.8 |
45
+
46
+ > 浅色主题下 `multiply` 作用在白底上比深色下的 `soft-light` 强得多,因此浅色的雾感默认取较轻的 0.1,并把网格加粗到 1.8 作为主要可见元素。
47
+
48
+ ## 安装
49
+
50
+ ```bash
51
+ dsh plugin --profile <你的profile> add dsh-right-bg-anim
52
+ ```
53
+
54
+ 安装后刷新页面即可。
55
+
56
+ ## 它刻意不做的事
57
+
58
+ - ❌ 不覆盖任何官方 CSS(上游主题插件的 89 条全局规则全部丢弃)
59
+ - ❌ 不覆盖 `--dsw-*` token,不锁定深色
60
+ - ❌ 不修改侧边栏、输入框、按钮、弹窗
61
+ - ❌ 无鱼儿动画
62
+
63
+ ## 目录
64
+
65
+ ```text
66
+ src/
67
+ client.js # 客户端入口:样式、挂层、阶段/主题观察、设置行
68
+ css.js # 唯一一份样式(图层 + 设置行)
69
+ settings.js # 设置存储与默认值
70
+ wallpaper-profile.js # 双模式配色:按明暗主题与参数现算
71
+ anim/
72
+ interaction-sources.js # 指针源,归一化到容器坐标
73
+ pointer-field.js # WebGL2 流体 host 侧
74
+ fluid-shaders.js # 流体着色器
75
+ fluid-profile.js # 流体运动参数
76
+ elastic-grid.js # Canvas2D 弹性网格
77
+ elastic-grid-profile.js # 网格参数
78
+ scripts/build.mjs # 零依赖单文件打包(含重名守卫)
79
+ lib/ # 构建产物
80
+ ```
81
+
82
+ ## 构建
83
+
84
+ ```bash
85
+ node scripts/build.mjs
86
+ ```
87
+
88
+ ## 致谢
89
+
90
+ 动画算法 fork 自 [dsh-official-homepage-theme](https://github.com/JohnnyTing/dsh-official-homepage-theme)@1.0.7(MIT)。本项目的改动集中在容器化(限制在右侧主内容区)、透明化、去主题化与参数化。
91
+
92
+ ## License
93
+
94
+ MIT
@@ -0,0 +1,5 @@
1
+ # DSH bundle patch: the profile merges this layer automatically once the package
2
+ # is listed in dsh.profile.bundles.
3
+ - insert:
4
+ - id: "@sparkelf/dsh-right-bg-anim"
5
+ name: '@sparkelf/dsh-right-bg-anim'
@@ -0,0 +1,20 @@
1
+ {
2
+ "id": "@sparkelf/dsh-right-bg-anim",
3
+ "version": "1.1.0",
4
+ "main": "./lib/index.js",
5
+ "description": "仅保留官方首页主题的背景动画:只在新会话的主内容区渲染,不影响侧边栏,其他 UI 全部保持官方。",
6
+ "client": {
7
+ "main": "./lib/client.js",
8
+ "inject": [
9
+ "@deepseek-ai/dsh-client-ui-slots",
10
+ "@deepseek-ai/dsh-client-ui-settings-general"
11
+ ]
12
+ },
13
+ "engines": {
14
+ "dsh": ">=0.1.0-rc.1"
15
+ },
16
+ "contributes": {
17
+ "tools": [],
18
+ "skills": []
19
+ }
20
+ }