mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
feat(theme): 默认主题改为紫色并升级版本至3.0.2触发打包
This commit is contained in:
+2
-2
@@ -572,9 +572,9 @@
|
|||||||
return /^#[0-9a-f]{6}$/i.test(cachedBackground || '') ? cachedBackground : null
|
return /^#[0-9a-f]{6}$/i.test(cachedBackground || '') ? cachedBackground : null
|
||||||
}
|
}
|
||||||
|
|
||||||
// 读取已保存的主题偏好,缺省时使用玻璃主题。
|
// 读取已保存的主题偏好,缺省时使用紫色主题。
|
||||||
function getSavedThemePreference() {
|
function getSavedThemePreference() {
|
||||||
return getLocalStorageValue('theme') || 'glass'
|
return getLocalStorageValue('theme') || 'purple'
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将启动阶段的主题偏好解析为实际主题。
|
// 将启动阶段的主题偏好解析为实际主题。
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "3.0.1",
|
"version": "3.0.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": "dist/service.js",
|
"bin": "dist/service.js",
|
||||||
|
|||||||
+3
-3
@@ -129,7 +129,7 @@ const glassMaterialTintColor = computed(
|
|||||||
normalizeThemeMaterialAccent(globalTheme.current.value.colors.primary)?.hex ??
|
normalizeThemeMaterialAccent(globalTheme.current.value.colors.primary)?.hex ??
|
||||||
normalizeThemeMaterialAccent(themeCustomizerPrimaryColors[0].value)!.hex,
|
normalizeThemeMaterialAccent(themeCustomizerPrimaryColors[0].value)!.hex,
|
||||||
)
|
)
|
||||||
let themeValue = localStorage.getItem('theme') || 'glass'
|
let themeValue = localStorage.getItem('theme') || 'purple'
|
||||||
let resumeThemeSyncTimer: number | null = null
|
let resumeThemeSyncTimer: number | null = null
|
||||||
globalTheme.name.value = resolveInitialThemeName(themeValue)
|
globalTheme.name.value = resolveInitialThemeName(themeValue)
|
||||||
applyStoredThemeCustomizerAppearance(vuetifyTheme)
|
applyStoredThemeCustomizerAppearance(vuetifyTheme)
|
||||||
@@ -527,7 +527,7 @@ function syncThemePreferenceFromStorage(preferCachedAuto = false) {
|
|||||||
resumeThemeSyncTimer = null
|
resumeThemeSyncTimer = null
|
||||||
}
|
}
|
||||||
|
|
||||||
themeValue = localStorage.getItem('theme') || 'glass'
|
themeValue = localStorage.getItem('theme') || 'purple'
|
||||||
|
|
||||||
const resolvedTheme =
|
const resolvedTheme =
|
||||||
themeValue === 'auto' && preferCachedAuto
|
themeValue === 'auto' && preferCachedAuto
|
||||||
@@ -561,7 +561,7 @@ function syncThemePreferenceFromStorage(preferCachedAuto = false) {
|
|||||||
|
|
||||||
// 系统配色变化时,在自动主题模式下刷新当前实际主题。
|
// 系统配色变化时,在自动主题模式下刷新当前实际主题。
|
||||||
function handleSystemThemeChange() {
|
function handleSystemThemeChange() {
|
||||||
if ((localStorage.getItem('theme') || 'glass') === 'auto') {
|
if ((localStorage.getItem('theme') || 'purple') === 'auto') {
|
||||||
syncThemePreferenceFromStorage()
|
syncThemePreferenceFromStorage()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ async function handleResetSettings() {
|
|||||||
await setRadius('default')
|
await setRadius('default')
|
||||||
await setShadow('0')
|
await setShadow('0')
|
||||||
await setSkin('default')
|
await setSkin('default')
|
||||||
await setTheme('glass')
|
await setTheme('purple')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -168,11 +168,11 @@ function isHexColor(color: unknown): color is string {
|
|||||||
|
|
||||||
/** 读取并校验本地存储中的主题偏好。 */
|
/** 读取并校验本地存储中的主题偏好。 */
|
||||||
function readStoredThemePreference(): ThemeCustomizerTheme {
|
function readStoredThemePreference(): ThemeCustomizerTheme {
|
||||||
if (!isBrowser()) return 'glass'
|
if (!isBrowser()) return 'purple'
|
||||||
|
|
||||||
const storedTheme = localStorage.getItem('theme')
|
const storedTheme = localStorage.getItem('theme')
|
||||||
|
|
||||||
return validThemes.includes(storedTheme as ThemeCustomizerTheme) ? (storedTheme as ThemeCustomizerTheme) : 'glass'
|
return validThemes.includes(storedTheme as ThemeCustomizerTheme) ? (storedTheme as ThemeCustomizerTheme) : 'purple'
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 从预设矩阵生成指定质量的清透自然玻璃默认设置。 */
|
/** 从预设矩阵生成指定质量的清透自然玻璃默认设置。 */
|
||||||
@@ -660,7 +660,7 @@ export function isDefaultThemeCustomizerSettings(settings: ThemeCustomizerSettin
|
|||||||
semiDarkMenu: false,
|
semiDarkMenu: false,
|
||||||
shadow: '0',
|
shadow: '0',
|
||||||
skin: 'default',
|
skin: 'default',
|
||||||
theme: 'glass',
|
theme: 'purple',
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -897,7 +897,7 @@ export function useThemeCustomizer() {
|
|||||||
semiDarkMenu: false,
|
semiDarkMenu: false,
|
||||||
shadow: '0',
|
shadow: '0',
|
||||||
skin: 'default',
|
skin: 'default',
|
||||||
theme: 'glass',
|
theme: 'purple',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ const getUIModeIcon = computed(() => {
|
|||||||
|
|
||||||
// 主题相关功能
|
// 主题相关功能
|
||||||
const { name: themeName, global: globalTheme } = useTheme()
|
const { name: themeName, global: globalTheme } = useTheme()
|
||||||
const savedTheme = ref(localStorage.getItem('theme') ?? 'glass')
|
const savedTheme = ref(localStorage.getItem('theme') ?? 'purple')
|
||||||
const currentThemeName = ref(savedTheme.value)
|
const currentThemeName = ref(savedTheme.value)
|
||||||
const themeCustomizerSettings = ref(readThemeCustomizerSettings())
|
const themeCustomizerSettings = ref(readThemeCustomizerSettings())
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ function getThemeLayoutTitle(layout: ThemeCustomizerSettings['layout']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currentThemeSummary = computed(() => {
|
const currentThemeSummary = computed(() => {
|
||||||
const themeTitle = themes.find(theme => theme.name === currentThemeName.value)?.title || t('theme.glass')
|
const themeTitle = themes.find(theme => theme.name === currentThemeName.value)?.title || t('theme.purple')
|
||||||
const layoutTitle = appMode.value ? '' : getThemeLayoutTitle(themeCustomizerSettings.value.layout)
|
const layoutTitle = appMode.value ? '' : getThemeLayoutTitle(themeCustomizerSettings.value.layout)
|
||||||
|
|
||||||
if (layoutTitle) return `${themeTitle} · ${layoutTitle}`
|
if (layoutTitle) return `${themeTitle} · ${layoutTitle}`
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ const AsyncAceEditor = defineAsyncComponent(async () => {
|
|||||||
|
|
||||||
const AsyncApexChart = defineAsyncComponent(async () => {
|
const AsyncApexChart = defineAsyncComponent(async () => {
|
||||||
const component = (await import('vue3-apexcharts')).default
|
const component = (await import('vue3-apexcharts')).default
|
||||||
const themeName = document.documentElement.getAttribute('data-theme') || localStorage.getItem('theme') || 'glass'
|
const themeName = document.documentElement.getAttribute('data-theme') || localStorage.getItem('theme') || 'purple'
|
||||||
configureApexChartsTheme(themeName)
|
configureApexChartsTheme(themeName)
|
||||||
return component
|
return component
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { VuetifyOptions } from 'vuetify'
|
import type { VuetifyOptions } from 'vuetify'
|
||||||
|
|
||||||
const theme: VuetifyOptions['theme'] = {
|
const theme: VuetifyOptions['theme'] = {
|
||||||
defaultTheme: 'glass',
|
defaultTheme: 'purple',
|
||||||
themes: {
|
themes: {
|
||||||
light: {
|
light: {
|
||||||
dark: false,
|
dark: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user