diff --git a/components/Common.vue b/components/Common.vue index 336d5a0..c5eb29f 100644 --- a/components/Common.vue +++ b/components/Common.vue @@ -47,7 +47,8 @@ export default { data () { return { isSidebarOpen: false, - isHasKey: true + isHasKey: true, + nightMode: false } }, @@ -94,7 +95,8 @@ export default { { 'no-navbar': !this.shouldShowNavbar, 'sidebar-open': this.isSidebarOpen, - 'no-sidebar': !this.shouldShowSidebar + 'no-sidebar': !this.shouldShowSidebar, + 'night-mode': this.nightMode }, userPageClass ] @@ -106,6 +108,11 @@ export default { this.isSidebarOpen = false }) + if (localStorage.getItem('nightMode')) { + document.documentElement.style.background = "#000" + this.nightMode = true + } + const keyPage = this.$site.themeConfig.keyPage if (!keyPage) { this.isHasKey = true diff --git a/components/Home.vue b/components/Home.vue index c2a29a7..35e6a32 100644 --- a/components/Home.vue +++ b/components/Home.vue @@ -1,5 +1,5 @@