dsh-remote-plugin 0.5.2 → 0.5.4

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.
@@ -0,0 +1,57 @@
1
+ /* DSH Remote 皮肤系统 · 零依赖
2
+ * html[data-theme] = default(默认深空) | dark(落日) | light(易北爱乐厅) | neutral(草原孤塔)
3
+ * 优先级: localStorage dshTheme > prefers-color-scheme(浅→light, 深→default)
4
+ * set() 写入用户显式选择; applyCurrent() 只应用不写, 用于跟随系统变化。 */
5
+ 'use strict'
6
+ ;(function () {
7
+ const KEY = 'dshTheme'
8
+ const VALID = ['default', 'dark', 'light', 'neutral']
9
+ const mq = window.matchMedia('(prefers-color-scheme: light)')
10
+ const store = {
11
+ get(k) { try { return localStorage.getItem(k) } catch { return null } },
12
+ set(k, v) { try { localStorage.setItem(k, v) } catch {} }
13
+ }
14
+
15
+ function system() {
16
+ return mq.matches ? 'light' : 'default'
17
+ }
18
+
19
+ function get() {
20
+ const saved = store.get(KEY)
21
+ return VALID.includes(saved) ? saved : system()
22
+ }
23
+
24
+ function syncMeta() {
25
+ const bg = getComputedStyle(document.documentElement).getPropertyValue('--dsr-bg').trim()
26
+ const meta = document.querySelector('meta[name="theme-color"]')
27
+ if (meta && bg) meta.setAttribute('content', bg)
28
+ }
29
+
30
+ function applyAttr(t) {
31
+ document.documentElement.setAttribute('data-theme', t)
32
+ syncMeta()
33
+ }
34
+
35
+ function applyCurrent() {
36
+ applyAttr(get())
37
+ return get()
38
+ }
39
+
40
+ function set(t) {
41
+ if (!VALID.includes(t)) t = get()
42
+ document.documentElement.setAttribute('data-theme', t)
43
+ store.set(KEY, t)
44
+ syncMeta()
45
+ return t
46
+ }
47
+
48
+ // 未手动选择时跟随系统变化
49
+ if (mq.addEventListener) {
50
+ mq.addEventListener('change', () => { if (!store.get(KEY)) applyCurrent() })
51
+ } else if (mq.addListener) {
52
+ mq.addListener(() => { if (!store.get(KEY)) applyCurrent() })
53
+ }
54
+
55
+ applyCurrent()
56
+ window.DSHTheme = { KEY, VALID, system, get, set, applyCurrent }
57
+ })()
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.5.2",
2
+ "version": "0.5.4",
3
3
  "apkUrl": "dsh-remote.apk",
4
- "releasedAt": "2026-08-16T05:47:22.411Z",
5
- "notes": "管理页二维码修复 SVG 尺寸白点并新增网关徽章一键开面板, 抽屉去标题栏沉浸式; App 扫码改为 Camera+jsQR 本地解码(无谷歌服务依赖, APK 27MB→9MB), 保留系统相机/手动输入冗余; 桌面端已回答的提问不再残留手机待办; Android 安装界面显示真实版本号"
4
+ "releasedAt": "2026-08-16T15:02:23.726Z",
5
+ "notes": "皮肤系统:默认深空/落日/易北爱乐厅/草原孤塔四套配色,设置与主机管理页面板选择,默认跟随系统深浅;管理页宽屏适配(设备表格断点重构消除临界滚动条);App 检查更新可展开完整更新说明;CSS 全部变量化(--dsr-*)"
6
6
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.5.2"
2
+ "version": "0.5.4"
3
3
  }