From abc5081db0c2f94ea96c9a907a194fd65f06f547 Mon Sep 17 00:00:00 2001 From: lish Date: Mon, 29 Nov 2021 13:43:02 +0800 Subject: [PATCH] upgrade dark css Signed-off-by: lish --- src/components/fixbar/index.component.ts | 4 +--- src/dark.scss | 8 +++++++- src/view/index/sim/index.component.html | 2 +- src/view/index/sim/index.component.ts | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/components/fixbar/index.component.ts b/src/components/fixbar/index.component.ts index 3450c7d..467f975 100644 --- a/src/components/fixbar/index.component.ts +++ b/src/components/fixbar/index.component.ts @@ -70,7 +70,6 @@ export class FixbarComponent { if (this.isDark) { document.documentElement.classList.add('dark-container') } - const url = this.router.url.split('?')[0] this.themeList = this.themeList.filter(t => { return t.url !== url @@ -133,8 +132,7 @@ export class FixbarComponent { mitt.emit('dark', this.isDark) window.localStorage.setItem(STORAGE_KEY_MAP.isDark, String(Number(this.isDark))) document.documentElement.classList.toggle('dark-container') - - if (this.isDark) { + if (this.isDark) { this.removeBackground() } else { const { data } = this.activatedRoute.snapshot diff --git a/src/dark.scss b/src/dark.scss index 98cb974..06b43c9 100644 --- a/src/dark.scss +++ b/src/dark.scss @@ -3,6 +3,12 @@ // .dark-container { + .ant-card-bordered.ant-card { + background: #0d1117; + } + .wallpaper{ + background-color: rgba(25, 29, 34, 1)!important; + } .dark { &-primary { color: #58a6ff !important; @@ -35,7 +41,7 @@ } &-text { - color: #6e7681 !important; + color: #cccccc !important; } &-text-active { diff --git a/src/view/index/sim/index.component.html b/src/view/index/sim/index.component.html index c7dd648..dd03a4d 100644 --- a/src/view/index/sim/index.component.html +++ b/src/view/index/sim/index.component.html @@ -1,5 +1,5 @@
-
+

{{ title }}

diff --git a/src/view/index/sim/index.component.ts b/src/view/index/sim/index.component.ts index 6177a98..d09b00a 100644 --- a/src/view/index/sim/index.component.ts +++ b/src/view/index/sim/index.component.ts @@ -35,6 +35,8 @@ export default class SimComponent { gitRepoUrl: string = gitRepoUrl title: string = title posterImageUrls?: string = simThemeConfig.posterImageUrls[0] + bgColor: string = 'rgba(0, 129, 255, 0.9)' + background: string = `url('${this.posterImageUrls}')` description: string = simThemeConfig.description.replace('${total}', String(totalWeb())) isLogin = isLogin -- GitLab