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.
- package/apk/dsh-remote.apk +0 -0
- package/package.json +1 -1
- package/public/admin.html +245 -45
- package/public/admin.js +137 -68
- package/public/app.js +294 -201
- package/public/i18n.js +52 -0
- package/public/index.html +328 -67
- package/public/styles.css +542 -173
- package/public/theme.js +57 -0
- package/public/update.json +3 -3
- package/public/version.json +1 -1
package/public/theme.js
ADDED
|
@@ -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
|
+
})()
|
package/public/update.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.5.
|
|
2
|
+
"version": "0.5.4",
|
|
3
3
|
"apkUrl": "dsh-remote.apk",
|
|
4
|
-
"releasedAt": "2026-08-
|
|
5
|
-
"notes": "
|
|
4
|
+
"releasedAt": "2026-08-16T15:02:23.726Z",
|
|
5
|
+
"notes": "皮肤系统:默认深空/落日/易北爱乐厅/草原孤塔四套配色,设置与主机管理页面板选择,默认跟随系统深浅;管理页宽屏适配(设备表格断点重构消除临界滚动条);App 检查更新可展开完整更新说明;CSS 全部变量化(--dsr-*)"
|
|
6
6
|
}
|
package/public/version.json
CHANGED