diff --git a/.vitepress/config.ts b/.vitepress/config.ts index da8f442..71b3c69 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -63,6 +63,18 @@ export default defineConfig({ ['link', { rel: 'icon', href: '/favicon.png' }], ['meta', { property: 'og:image', content: '/og-image.png' }], ['meta', { name: 'theme-color', content: '#C8963E' }], + ['script', {}, ` + (function(){ + var E='mengstack-theme-explicit',V='vitepress-theme-appearance'; + var d=false,e=localStorage.getItem(E); + if(e!==null){d=e==='true'} + else if(window.matchMedia&&window.matchMedia('(prefers-color-scheme:dark)').matches){d=true} + else if(window.matchMedia&&window.matchMedia('(prefers-color-scheme:light)').matches){d=false} + else{var h=new Date().getHours();d=h<8||h>=18} + if(d)document.documentElement.classList.add('dark'); + try{localStorage.setItem(V,String(d))}catch(x){} + })() + `], ], transformHead({ pageData }) { diff --git a/.vitepress/theme/Home.vue b/.vitepress/theme/Home.vue index 3ea2929..35ebe69 100644 --- a/.vitepress/theme/Home.vue +++ b/.vitepress/theme/Home.vue @@ -18,7 +18,7 @@ 社区
- @@ -338,18 +338,14 @@ Check /health