From 9dfa7b35b6d018a82d5ff2689ebcd49ff69a8473 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Tue, 25 Jul 2023 02:26:04 +0800 Subject: [PATCH] style: adjusted some style * fix: resolve issue with the loading wallpaper & mask opacity on initial page load --- .../Settings/components/Appearance.vue | 21 +-------- src/components/Slider.vue | 30 ++++++++++--- src/components/Topbar/Topbar.vue | 1 + src/contentScripts/views/App.vue | 22 +++++++--- src/styles/main.scss | 44 +------------------ 5 files changed, 44 insertions(+), 74 deletions(-) diff --git a/src/components/Settings/components/Appearance.vue b/src/components/Settings/components/Appearance.vue index f0c718f9..8317e309 100644 --- a/src/components/Settings/components/Appearance.vue +++ b/src/components/Settings/components/Appearance.vue @@ -155,30 +155,13 @@ function changeWallpaper(url: string) { -
- - {{ settings.wallpaperMaskOpacity }}% -
- +
-
- - {{ settings.wallpaperBlurIntensity }}px -
+
diff --git a/src/components/Slider.vue b/src/components/Slider.vue index 77bb620b..64d90c2b 100644 --- a/src/components/Slider.vue +++ b/src/components/Slider.vue @@ -1,13 +1,32 @@ @@ -32,8 +52,8 @@ label { --b-border-width: 2px; --b-slider-height: 10px; --b-slider-width: 100%; - --b-thumb-width: calc(25px - var(--b-border-width)); - --b-thumb-height: calc(25px - var(--b-border-width)); + --b-thumb-width: calc(20px - var(--b-border-width)); + --b-thumb-height: calc(20px - var(--b-border-width)); } input[type="range"] { diff --git a/src/components/Topbar/Topbar.vue b/src/components/Topbar/Topbar.vue index 19028203..76fcc18b 100644 --- a/src/components/Topbar/Topbar.vue +++ b/src/components/Topbar/Topbar.vue @@ -155,6 +155,7 @@ async function getUnreadMessageCount() { } } catch (error) { + unReadMessageCount.value = 0 console.error(error) } } diff --git a/src/contentScripts/views/App.vue b/src/contentScripts/views/App.vue index de0ba094..43e3f80b 100644 --- a/src/contentScripts/views/App.vue +++ b/src/contentScripts/views/App.vue @@ -81,16 +81,11 @@ watch(() => accessKey.value, () => { }) watch(() => settings.value.wallpaper, (newValue) => { - document.documentElement.style.backgroundImage = `url(${newValue})` - document.documentElement.style.backgroundSize = 'cover' - document.documentElement.style.backgroundPosition = 'center' + setAppWallpaper() }) watch(() => settings.value.wallpaperMaskOpacity, (newValue) => { - const bewlyElement = document.querySelector('#bewly') as HTMLElement - - bewlyElement.style - .setProperty('--bew-bg-mask-opacity', `${newValue}%`) + setAppWallpaperMaskingOpacity() }) onMounted(() => { @@ -123,6 +118,8 @@ onMounted(() => { setAppAppearance() setAppLanguage() setAppThemeColor() + setAppWallpaper() + setAppWallpaperMaskingOpacity() }) function changeActivatePage(pageName: AppPage) { @@ -175,6 +172,17 @@ function setAppThemeColor() { bewlyElement.style.setProperty(`--bew-theme-color-${i + 1}0`, hexToRGBA(settings.value.themeColor, i * 0.1 + 0.1)) } } + +function setAppWallpaper() { + document.documentElement.style.backgroundImage = `url(${settings.value.wallpaper})` + document.documentElement.style.backgroundSize = 'cover' + document.documentElement.style.backgroundPosition = 'center' +} + +function setAppWallpaperMaskingOpacity() { + const bewlyElement = document.querySelector('#bewly') as HTMLElement + bewlyElement.style.setProperty('--bew-bg-mask-opacity', `${settings.value.wallpaperMaskOpacity}%`) +}