优化: 知识卡片交互+deepseek模型+鼠标钩子

This commit is contained in:
lxy
2026-06-05 21:45:45 +08:00
parent 004dba7db6
commit 0302546267
10 changed files with 667 additions and 77 deletions
+11 -5
View File
@@ -38,6 +38,16 @@ const s = reactive<SettingsData>({
audioVizStyle: 'bars', audioSensitivity: 1.5, audioSmoothing: 0.7, audioColorScheme: 'neon',
})
async function refreshFromGo() {
const raw = await go.loadAllSettings()
const data = JSON.parse(raw) as SettingsData
if (data.lightTheme) document.documentElement.className = 'light'
Object.assign(s, { ...data, citiesByProv: data.citiesByProv || {}, provinces: data.provinces || [], themes: data.themes || [], savedColors: data.savedColors || [] })
if (data.color1) { currentColor.c1 = data.color1; currentColor.c2 = data.color2 || ''; currentColor.gradient = data.colorGradient || false }
}
;(window as any).__refreshSettings = refreshFromGo
// Shared state for color section
const currentColor = reactive({ c1: '', c2: '', gradient: false })
@@ -76,11 +86,7 @@ async function onRemoveSavedColor(idx: number) {
}
onMounted(async () => {
const raw = await go.loadAllSettings()
const data = JSON.parse(raw) as SettingsData
if (data.lightTheme) document.documentElement.className = 'light'
Object.assign(s, { ...data, citiesByProv: data.citiesByProv || {}, provinces: data.provinces || [], themes: data.themes || [], savedColors: data.savedColors || [] })
if (data.color1) { currentColor.c1 = data.color1; currentColor.c2 = data.color2 || ''; currentColor.gradient = data.colorGradient || false }
await refreshFromGo()
setTimeout(() => {
const el = document.documentElement
if (go.resizeToFit) go.resizeToFit(el.scrollWidth, el.scrollHeight + 8)