| | |
| | | import AppConfig from '@/config' |
| | | import { SystemThemeEnum } from '@/enums/appEnum' |
| | | import { setElementThemeColor } from '@/utils/ui' |
| | | import { useCeremony } from '@/hooks/core/useCeremony' |
| | | import { StorageConfig } from '@/utils' |
| | | import { SETTING_DEFAULT_CONFIG } from '@/config/setting' |
| | | const useSettingStore = defineStore( |
| | |
| | | const showLanguage = ref(SETTING_DEFAULT_CONFIG.showLanguage) |
| | | const showNprogress = ref(SETTING_DEFAULT_CONFIG.showNprogress) |
| | | const showSettingGuide = ref(SETTING_DEFAULT_CONFIG.showSettingGuide) |
| | | const showFestivalText = ref(SETTING_DEFAULT_CONFIG.showFestivalText) |
| | | const watermarkVisible = ref(SETTING_DEFAULT_CONFIG.watermarkVisible) |
| | | const autoClose = ref(SETTING_DEFAULT_CONFIG.autoClose) |
| | | const uniqueOpened = ref(SETTING_DEFAULT_CONFIG.uniqueOpened) |
| | | const colorWeak = ref(SETTING_DEFAULT_CONFIG.colorWeak) |
| | | const refresh = ref(SETTING_DEFAULT_CONFIG.refresh) |
| | | const holidayFireworksLoaded = ref(SETTING_DEFAULT_CONFIG.holidayFireworksLoaded) |
| | | const boxBorderMode = ref(SETTING_DEFAULT_CONFIG.boxBorderMode) |
| | | const pageTransition = ref(SETTING_DEFAULT_CONFIG.pageTransition) |
| | | const tabStyle = ref(SETTING_DEFAULT_CONFIG.tabStyle) |
| | | const customRadius = ref(SETTING_DEFAULT_CONFIG.customRadius) |
| | | const containerWidth = ref(SETTING_DEFAULT_CONFIG.containerWidth) |
| | | const festivalDate = ref('') |
| | | const getMenuTheme = computed(() => { |
| | | const list = AppConfig.themeList.filter((item) => item.theme === menuThemeType.value) |
| | | if (isDark.value) { |
| | |
| | | }) |
| | | const getCustomRadius = computed(() => { |
| | | return customRadius.value + 'rem' || SETTING_DEFAULT_CONFIG.customRadius + 'rem' |
| | | }) |
| | | const isShowFireworks = computed(() => { |
| | | return festivalDate.value === useCeremony().currentFestivalData.value?.date ? false : true |
| | | }) |
| | | const switchMenuLayouts = (type) => { |
| | | menuType.value = type |
| | |
| | | customRadius.value = radius |
| | | document.documentElement.style.setProperty('--custom-radius', `${radius}rem`) |
| | | } |
| | | const setholidayFireworksLoaded = (isLoad) => { |
| | | holidayFireworksLoaded.value = isLoad |
| | | } |
| | | const setShowFestivalText = (show) => { |
| | | showFestivalText.value = show |
| | | } |
| | | const setFestivalDate = (date) => { |
| | | festivalDate.value = date |
| | | } |
| | | const setDualMenuShowText = (show) => { |
| | | dualMenuShowText.value = show |
| | | } |
| | |
| | | refresh, |
| | | watermarkVisible, |
| | | customRadius, |
| | | holidayFireworksLoaded, |
| | | showFestivalText, |
| | | festivalDate, |
| | | dualMenuShowText, |
| | | containerWidth, |
| | | getMenuTheme, |
| | | isDark, |
| | | getMenuOpenWidth, |
| | | getCustomRadius, |
| | | isShowFireworks, |
| | | switchMenuLayouts, |
| | | setMenuOpenWidth, |
| | | setGlopTheme, |
| | |
| | | reload, |
| | | setWatermarkVisible, |
| | | setCustomRadius, |
| | | setholidayFireworksLoaded, |
| | | setShowFestivalText, |
| | | setFestivalDate, |
| | | setDualMenuShowText |
| | | } |
| | | }, |