Files
momentry_studio/src/stores/themeStore.ts
Momentry Studio f3d75ebce8 feat: Library 批量注册 + PeopleView 修复 + 国际化
Library:
- 添加 checkbox 和鼠标框选功能
- Unregistered 卡片添加快速注册按钮
- 状态标签移至左下方,人脸图标移至左侧中间
- Deep Scan 改为 unregister -> register -> process
- 完整国际化(日语、繁体中文、英语)

PeopleView:
- 修复卡片不显示问题(使用 get_file_traces API)
- 移除对 identity_id 字段的依赖

其他:
- 添加日语语言包
- 添加 useDragSelect composable
- 新增文档:Face Bbox Null Bug Report
2026-10-01 00:42:13 +08:00

33 lines
889 B
TypeScript

import { ref, watch, onMounted } from 'vue'
const THEME_KEY = 'momentry_theme'
const saved = localStorage.getItem(THEME_KEY) || 'auto'
const theme = ref(saved)
function applyTheme(t: string) {
if (t === 'auto') {
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
document.documentElement.setAttribute('data-theme', prefersDark ? 'dark' : 'light')
} else {
document.documentElement.setAttribute('data-theme', t)
}
}
watch(theme, (v) => {
localStorage.setItem(THEME_KEY, v)
applyTheme(v)
})
export function useTheme() {
onMounted(() => applyTheme(theme.value))
function toggleTheme() {
const current = theme.value === 'auto'
? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')
: theme.value
theme.value = current === 'dark' ? 'light' : 'dark'
}
return { theme, toggleTheme }
}