From fae6cf58ea6e0a0db389b63c1677f17a39769745 Mon Sep 17 00:00:00 2001 From: reco_luan Date: Sun, 14 Apr 2019 13:29:01 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=EF=BC=9B?= =?UTF-8?q?2.=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5=E5=A4=9C=E6=99=9A?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=8C=E6=95=88=E6=9E=9C=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E5=AE=8C=E6=AF=95=E5=BC=80=E5=85=B3=E4=BD=8D=E5=BC=84=E5=A5=BD?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E6=9C=9F=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E9=A2=9C=E8=89=B2=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Common.vue | 11 ++- components/Home.vue | 78 +++++++++++++++-- components/Navbar.vue | 4 +- components/Page.vue | 23 ++++- components/Theme/CogIcon.vue | 20 +++++ components/Theme/ThemeOptions.vue | 112 ++++++++++++++++++++++++ components/Theme/index.vue | 140 ++++++++++++++++++++++++++++++ components/Theme/themeHandler.js | 46 ++++++++++ components/Theme/yuuConfig.js | 19 ++++ components/Valine/index.vue | 4 +- package.json | 3 +- styles/custom-blocks.styl | 14 +-- styles/loadMixin.styl | 11 +++ styles/nightMode.styl | 88 +++++++++++++++++++ styles/recoConfig.styl | 3 + styles/theme.styl | 3 +- 16 files changed, 557 insertions(+), 22 deletions(-) create mode 100755 components/Theme/CogIcon.vue create mode 100755 components/Theme/ThemeOptions.vue create mode 100755 components/Theme/index.vue create mode 100755 components/Theme/themeHandler.js create mode 100755 components/Theme/yuuConfig.js create mode 100644 styles/loadMixin.styl create mode 100644 styles/nightMode.styl create mode 100644 styles/recoConfig.styl 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 @@