mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: linear gradient theme color background
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useDark } from '~/composables/useDark'
|
||||
import { AppPage } from '~/enums/appEnums'
|
||||
import { settings } from '~/logic'
|
||||
|
||||
const props = defineProps<{ activatedPage: AppPage }>()
|
||||
|
||||
const { isDark } = useDark()
|
||||
|
||||
watch(() => settings.value.wallpaperMaskOpacity, () => {
|
||||
setAppWallpaperMaskingOpacity()
|
||||
})
|
||||
@@ -33,44 +36,76 @@ function setAppWallpaperMaskingOpacity() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Transition name="fade">
|
||||
<div v-if="activatedPage === AppPage.Search">
|
||||
<!-- background -->
|
||||
<div>
|
||||
<Transition name="fade">
|
||||
<!-- linear gradient background -->
|
||||
<div
|
||||
pos="absolute top-0 left-0" w-full h-full duration-300 bg="cover center $bew-homepage-bg"
|
||||
z--1 transform-gpu
|
||||
:style="{ backgroundImage: `url('${settings.individuallySetSearchPageWallpaper ? settings.searchPageWallpaper : settings.wallpaper}')` }"
|
||||
/>
|
||||
<!-- background mask -->
|
||||
<Transition name="fade">
|
||||
v-if="settings.useLinearGradientThemeColorBackground && isDark"
|
||||
pos="absolute top-0 left-0" w-full h-full z-0 pointer-events-none
|
||||
of-hidden opacity-60
|
||||
>
|
||||
<div
|
||||
v-if="(!settings.individuallySetSearchPageWallpaper && settings.enableWallpaperMasking) || (settings.searchPageEnableWallpaperMasking)"
|
||||
pos="absolute top-0 left-0" w-full h-full pointer-events-none bg="$bew-homepage-bg-mask"
|
||||
duration-300 z--1 transform-gpu
|
||||
:style="{
|
||||
backdropFilter: `blur(${settings.individuallySetSearchPageWallpaper ? settings.searchPageWallpaperBlurIntensity : settings.wallpaperBlurIntensity}px)`,
|
||||
}"
|
||||
pos="absolute bottom--20% left-50%" transform="translate-x--1/2" w="120%" h="60%" bg="$bew-theme-color"
|
||||
important-blur-140 important-saturate-240
|
||||
rounded-full z-1
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!-- background -->
|
||||
<div
|
||||
:style="{ backgroundImage: `url('${settings.wallpaper}')` }"
|
||||
pos="absolute top-0 left-0" w-full h-full duration-300 bg="cover center $bew-homepage-bg"
|
||||
z--1 transform-gpu
|
||||
/>
|
||||
<!-- background mask -->
|
||||
<Transition name="fade">
|
||||
<div
|
||||
v-if="settings.enableWallpaperMasking"
|
||||
pos="absolute top-0 left-0" w-full h-full pointer-events-none bg="$bew-homepage-bg-mask"
|
||||
duration-300 z--1 transform-gpu
|
||||
:style="{
|
||||
backdropFilter: `blur(${settings.wallpaperBlurIntensity}px)`,
|
||||
}"
|
||||
pos="absolute bottom--30% left-50%" transform="translate-x--1/2" w="110%" h="50%" bg="$bew-theme-color"
|
||||
important-blur-120 important-brightness-120
|
||||
rounded-full z-2
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
</Transition>
|
||||
<div
|
||||
pos="absolute bottom--30% left-50%" transform="translate-x--1/2" w="110%" h="50%" bg="$bew-theme-color"
|
||||
important-blur-100 important-brightness-180
|
||||
rounded-full z-3
|
||||
/>
|
||||
<div
|
||||
pos="absolute bottom--36% left-50%" transform="translate-x--1/2" w="110%" h="40%" bg-white
|
||||
important-blur-100
|
||||
rounded-full z-3
|
||||
/>
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
<Transition name="fade">
|
||||
<div v-if="activatedPage === AppPage.Search">
|
||||
<!-- background -->
|
||||
<div
|
||||
pos="absolute top-0 left-0" w-full h-full duration-300 bg="cover center $bew-homepage-bg"
|
||||
z--1 transform-gpu
|
||||
:style="{ backgroundImage: `url('${settings.individuallySetSearchPageWallpaper ? settings.searchPageWallpaper : settings.wallpaper}')` }"
|
||||
/>
|
||||
<!-- background mask -->
|
||||
<Transition name="fade">
|
||||
<div
|
||||
v-if="(!settings.individuallySetSearchPageWallpaper && settings.enableWallpaperMasking) || (settings.searchPageEnableWallpaperMasking)"
|
||||
pos="absolute top-0 left-0" w-full h-full pointer-events-none bg="$bew-homepage-bg-mask"
|
||||
duration-300 z--1 transform-gpu
|
||||
:style="{
|
||||
backdropFilter: `blur(${settings.individuallySetSearchPageWallpaper ? settings.searchPageWallpaperBlurIntensity : settings.wallpaperBlurIntensity}px)`,
|
||||
}"
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!-- background -->
|
||||
<div
|
||||
:style="{ backgroundImage: `url('${settings.wallpaper}')` }"
|
||||
pos="absolute top-0 left-0" w-full h-full duration-300 bg="cover center $bew-homepage-bg"
|
||||
z--1 transform-gpu
|
||||
/>
|
||||
<!-- background mask -->
|
||||
<Transition name="fade">
|
||||
<div
|
||||
v-if="settings.enableWallpaperMasking"
|
||||
pos="absolute top-0 left-0" w-full h-full pointer-events-none bg="$bew-homepage-bg-mask"
|
||||
duration-300 z--1 transform-gpu
|
||||
:style="{
|
||||
backdropFilter: `blur(${settings.wallpaperBlurIntensity}px)`,
|
||||
}"
|
||||
/>
|
||||
</Transition>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -115,6 +115,10 @@ function changeWallpaper(url: string) {
|
||||
</div>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem title="Use linear gradient theme color background when in dark mode">
|
||||
<Radio v-model="settings.useLinearGradientThemeColorBackground" />
|
||||
</SettingsItem>
|
||||
</SettingsItemGroup>
|
||||
|
||||
<ChangeWallpaper type="global" />
|
||||
|
||||
@@ -30,6 +30,7 @@ export interface Settings {
|
||||
|
||||
theme: 'light' | 'dark' | 'auto'
|
||||
themeColor: string
|
||||
useLinearGradientThemeColorBackground: boolean
|
||||
wallpaperMode: 'buildIn' | 'byUrl'
|
||||
wallpaper: string
|
||||
enableWallpaperMasking: boolean
|
||||
@@ -87,6 +88,7 @@ export const settings = useStorageLocal('settings', ref<Settings>({
|
||||
|
||||
theme: 'auto',
|
||||
themeColor: '#00a1d6',
|
||||
useLinearGradientThemeColorBackground: false,
|
||||
wallpaperMode: 'buildIn',
|
||||
wallpaper: '',
|
||||
enableWallpaperMasking: false,
|
||||
|
||||
Reference in New Issue
Block a user