feat(console): 模糊度预设按背景(流光8/自定义8/纯色0);恢复初始一并复位B/T;更新公告磁片模糊锁死8px(不随用户设置)

This commit is contained in:
Aisland
2026-09-02 00:27:00 +08:00
parent a5bec7e43d
commit dc9c6a86ec
4 changed files with 44 additions and 12 deletions
+2 -2
View File
@@ -1420,11 +1420,11 @@ function WorktableSection(props: any) {
setPhotoGrid: (v: boolean) => persistView({ consoleBgPhotoGrid: v }),
getGridOpacity: () => viewRef.current.consoleBgGridOpacity ?? 8,
setGridOpacity: (v: number) => persistView({ consoleBgGridOpacity: v }),
getCardBlur: () => viewRef.current.consoleCardBlur ?? 0,
getCardBlur: () => viewRef.current.consoleCardBlur ?? 8,
setCardBlur: (v: number) => persistView({ consoleCardBlur: v }),
getPlainBlur: () => viewRef.current.consoleBgPlainBlur ?? 0,
setPlainBlur: (v: number) => persistView({ consoleBgPlainBlur: v }),
getGlowBlur: () => viewRef.current.consoleBgGlowBlur ?? 0,
getGlowBlur: () => viewRef.current.consoleBgGlowBlur ?? 8,
setGlowBlur: (v: number) => persistView({ consoleBgGlowBlur: v }),
getPlainGrid: () => viewRef.current.consoleBgPlainGrid ?? 5,
setPlainGrid: (v: number) => persistView({ consoleBgPlainGrid: v }),
+15 -3
View File
@@ -1424,9 +1424,9 @@ function ConsolePane() {
const [bgVideo, setBgVideo] = useState<string>('')
const [photoGrid, setPhotoGridState] = useState<boolean>(() => splitEnv?.console?.getPhotoGrid?.() ?? true)
const [gridOpacity, setGridOpacityState] = useState<number>(() => splitEnv?.console?.getGridOpacity?.() ?? 8)
const [cardBlur, setCardBlurState] = useState<number>(() => splitEnv?.console?.getCardBlur?.() ?? 0)
const [cardBlur, setCardBlurState] = useState<number>(() => splitEnv?.console?.getCardBlur?.() ?? 8)
const [plainBlur, setPlainBlurState] = useState<number>(() => splitEnv?.console?.getPlainBlur?.() ?? 0)
const [glowBlur, setGlowBlurState] = useState<number>(() => splitEnv?.console?.getGlowBlur?.() ?? 0)
const [glowBlur, setGlowBlurState] = useState<number>(() => splitEnv?.console?.getGlowBlur?.() ?? 8)
const [plainGrid, setPlainGridState] = useState<number>(() => splitEnv?.console?.getPlainGrid?.() ?? 5)
const [glowGrid, setGlowGridState] = useState<number>(() => splitEnv?.console?.getGlowGrid?.() ?? 8)
const [annOpen, setAnnOpen] = useState(false)
@@ -1601,6 +1601,18 @@ function ConsolePane() {
}
}
const resetHsl = (kind: 'plain' | 'glow' | 'photo') => {
// 恢复初始:连同贴片模糊(B)/网格不透明度(T)一起复位(纯色 B=0,流光/自定义 B=8)
const blurDef = kind === 'plain' ? 0 : 8
if (kind === 'plain') {
setPlainBlurState(blurDef); splitEnv?.console?.setPlainBlur?.(blurDef)
setPlainGridState(5); splitEnv?.console?.setPlainGrid?.(5)
} else if (kind === 'glow') {
setGlowBlurState(blurDef); splitEnv?.console?.setGlowBlur?.(blurDef)
setGlowGridState(8); splitEnv?.console?.setGlowGrid?.(8)
} else {
setCardBlurState(blurDef); splitEnv?.console?.setCardBlur?.(blurDef)
setGridOpacityState(8); splitEnv?.console?.setGridOpacity?.(8)
}
if (kind === 'plain') {
const def = resolvedTheme === 'light' ? { ...PLAIN_HSL_LIGHT } : { ...PLAIN_HSL_DARK }
setPlainHslState(def)
@@ -1890,7 +1902,7 @@ function ConsolePane() {
<div className="dsh-wt_hslRow" data-tip={T('console.bgTipH')}><span className="dsh-wt_hslLabel">H</span><input className="dsh-wt_hslSlider" type="range" min={-180} max={180} step={1} value={v.h} onChange={(e) => editHsl(bgEdit, { h: Number(e.target.value) })} /><HslValInput value={v.h} min={-180} max={180} onCommit={(n) => editHsl(bgEdit, { h: n })} /></div>
<div className="dsh-wt_hslRow" data-tip={T('console.bgTipS')}><span className="dsh-wt_hslLabel">S</span><input className="dsh-wt_hslSlider" type="range" min={0} max={sMax} step={1} value={v.s} onChange={(e) => editHsl(bgEdit, { s: Number(e.target.value) })} /><HslValInput value={v.s} max={sMax} onCommit={(n) => editHsl(bgEdit, { s: n })} /></div>
<div className="dsh-wt_hslRow" data-tip={T('console.bgTipL')}><span className="dsh-wt_hslLabel">L</span><input className="dsh-wt_hslSlider" type="range" min={0} max={lMax} step={1} value={v.l} onChange={(e) => editHsl(bgEdit, { l: Number(e.target.value) })} /><HslValInput value={v.l} max={lMax} onCommit={(n) => editHsl(bgEdit, { l: n })} /></div>
<button type="button" className="dsh-wt_hslReset" onClick={() => resetHsl(bgEdit)}>{T('console.bgEditReset')}</button>
<button type="button" className="dsh-wt_hslReset" onClick={() => resetHsl(bgEdit)}>{T('console.bgEditReset')}(含 B/T)</button>
</>)
})()}
</div>
+1 -1
View File
@@ -430,7 +430,7 @@ export const css = xtermCss + '\n' + [
'.dsh-wt_consoleScroll{flex:1;min-height:0;overflow:auto;padding-bottom:10px}',
'.dsh-wt_announceCtr{display:flex;min-height:100%;align-items:center;justify-content:center;box-sizing:border-box}',
'.dsh-wt_announceCtr .dsh-wt_announce{margin:auto}',
'.dsh-wt_announce{width:100%;max-width:856px;margin:0 auto;display:flex;flex-direction:column;gap:12px;padding:26px;border-radius:16px;background:linear-gradient(135deg,rgba(255,255,255,.22) 0%,rgba(255,255,255,.07) 30%,rgba(255,255,255,.01) 60%,rgba(0,0,0,.07) 100%),rgba(18,23,32,.24);border:1px solid transparent;box-shadow:0 10px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.13);box-sizing:border-box;backdrop-filter:blur(var(--wt-cardBlur,0px)) saturate(1.15)}',
'.dsh-wt_announce{width:100%;max-width:856px;margin:0 auto;display:flex;flex-direction:column;gap:12px;padding:26px;border-radius:16px;background:linear-gradient(135deg,rgba(255,255,255,.22) 0%,rgba(255,255,255,.07) 30%,rgba(255,255,255,.01) 60%,rgba(0,0,0,.07) 100%),rgba(18,23,32,.24);border:1px solid transparent;box-shadow:0 10px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.13);box-sizing:border-box;backdrop-filter:blur(8px) saturate(1.15)}',
'.dsh-wt_console[data-wt-theme=light] .dsh-wt_announce{background:linear-gradient(135deg,rgba(255,255,255,1) 0%,rgba(255,255,255,.65) 30%,rgba(255,255,255,.12) 60%,rgba(31,41,55,.06) 100%),rgba(255,255,255,.34);box-shadow:0 10px 28px rgba(31,41,55,.18),inset 0 1px 0 rgba(255,255,255,1)}',
'.dsh-wt_announceHead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px solid var(--wt-border)}',
'.dsh-wt_announceVer{font-size:15px;font-weight:700;color:var(--wt-text)}',