-
diff --git a/layouts/UserLayout.vue b/layouts/UserLayout.vue
index 1e1e264..0de2a6b 100644
--- a/layouts/UserLayout.vue
+++ b/layouts/UserLayout.vue
@@ -61,6 +61,11 @@ useRouter().beforeEach(() => {
useRouter().afterEach(() => {
isLoading.value = false;
});
+
+const mounted = ref(false);
+onMounted(() => {
+ mounted.value = true;
+});
@@ -75,7 +80,7 @@ useRouter().afterEach(() => {
}"
@mouseleave="collapsed = true">
-
+
{
class="opacity-20 max-h-[48px] flex w-full h-full fixed bg-[url('/anime-8788959.jpg')] bg-cover bg-center"/>
-
+
@@ -123,13 +128,8 @@ useRouter().afterEach(() => {
diff --git a/package.json b/package.json
index 14d1cb6..b79bcac 100644
--- a/package.json
+++ b/package.json
@@ -33,9 +33,11 @@
"vue-router": "^4.5.1",
"word-count": "^0.3.1"
},
- "packageManager": "pnpm@10.17.1",
+ "packageManager": "pnpm@10.18.0",
"devDependencies": {
+ "@iconify-json/clarity": "^1.2.4",
"@iconify-json/lucide": "^1.2.68",
+ "@iconify-json/material-symbols": "^1.2.40",
"@stylistic/eslint-plugin": "^5.4.0",
"@stylistic/eslint-plugin-jsx": "^4.4.1",
"@vue/eslint-config-typescript": "^14.6.0",
diff --git a/pages/index/components/ArticleCard.vue b/pages/index/components/ArticleCard.vue
index 7aecb0f..b635b86 100644
--- a/pages/index/components/ArticleCard.vue
+++ b/pages/index/components/ArticleCard.vue
@@ -2,7 +2,6 @@
import { DataAnomaly, defaultMetaData } from '~/types/PostMetaData';
import type { PostMetaData } from '~/types/PostMetaData';
-import breakpointsHelper from '~/utils/BreakpointsHelper';
import { OverlayScrollbarsComponent } from 'overlayscrollbars-vue';
withDefaults(defineProps<{
@@ -45,6 +44,11 @@ function getCostTime(length: number | DataAnomaly | undefined) {
return `${minutes}分钟`;
}
}
+
+const mounted = ref(false);
+onMounted(() => {
+ mounted.value = true;
+});
@@ -94,24 +98,17 @@ function getCostTime(length: number | DataAnomaly | undefined) {
{{ metaData?.description }}
-
-
-
+
+
+
+
diff --git a/public/darkVerify.js b/public/darkVerify.js
index 495346d..4c23ea9 100644
--- a/public/darkVerify.js
+++ b/public/darkVerify.js
@@ -1,8 +1,6 @@
// darkVerify.js
if (
- localStorage.getItem('system-theme-mode') === "dark" ||
- (!localStorage.getItem('system-theme-mode') &&
- window.matchMedia("(prefers-color-scheme: dark)").matches)
+ window.matchMedia("(prefers-color-scheme: dark)").matches
) {
document.querySelector('html').classList.add('dark');
document.querySelector('html').classList.remove('light');
diff --git a/stores/colorModeStore.ts b/stores/colorModeStore.ts
index 11a3196..32229f8 100644
--- a/stores/colorModeStore.ts
+++ b/stores/colorModeStore.ts
@@ -5,12 +5,12 @@ function getInitialMode(): 'light' | 'dark' {
if (document.documentElement.classList.contains('light')) return 'light';
// 其次用 localStorage
const val = localStorage.getItem('system-theme-mode');
- if (!!val || (val !== 'light' && val !== 'dark'))
- return 'light';
- return val;
+ if (val === 'dark') return 'dark';
+ if (val === 'light') return 'light';
+ return 'light'; // 默认
}
return 'light'; // SSR 默认
-};
+}
const useColorModeStore = defineStore('colorMode', {
state: () => ({