feat: enable automatic wallpaper masking

if you had already set the wallpaper, it enables the wallpaper masking to prevent text hard to see
This commit is contained in:
Hakadao
2024-03-02 22:08:30 -03:00
parent a3143d1b44
commit 4318cc569b
2 changed files with 7 additions and 20 deletions

View File

@@ -25,9 +25,6 @@ const themeColorOptions = computed<Array<string>>(() => {
'#fda4af',
]
})
// const bilibiliEvolvedThemeColor = computed(() => {
// return getComputedStyle(document.querySelector('html') as HTMLElement).getPropertyValue('--theme-color').trim() ?? '#00a1d6'
// })
const wallpapers = computed<Array<{ name: string, url: string, thumbnail: string }>>(() => {
return [
{
@@ -74,6 +71,12 @@ function changeThemeColor(color: string) {
}
function changeWallpaper(url: string) {
// If you had already set the wallpaper, it enables the wallpaper masking to prevent text hard to see
if (url)
settings.value.enableWallpaperMasking = true
else
settings.value.enableWallpaperMasking = false
settings.value.wallpaper = url
}
</script>
@@ -100,22 +103,6 @@ function changeWallpaper(url: string) {
/>
</div>
</SettingsItem>
<!-- <SettingsItem :title="$t('settings.follow_bilibili_evolved_color')" :desc="$t('settings.follow_bilibili_evolved_color_desc')">
<div
w-20px h-20px rounded-8 cursor-pointer transition
duration-300 box-border
:style="{
background: bilibiliEvolvedThemeColor,
transform: bilibiliEvolvedThemeColor === settings.themeColor ? 'scale(1.3)' : 'scale(1)',
border: bilibiliEvolvedThemeColor === settings.themeColor ? '2px solid white' : '2px solid transparent',
boxShadow: bilibiliEvolvedThemeColor === settings.themeColor ? '0 0 0 1px var(--bew-border-color), var(--bew-shadow-1)' : 'none',
}"
@click="changeThemeColor(bilibiliEvolvedThemeColor)"
/>
</SettingsItem> -->
<!-- <SettingsItem :title="$t('settings.adapt_to_other_page_styles')" :desc="$t('settings.adapt_to_other_page_styles_desc')">
<Radio v-model="settings.adaptToOtherPageStyles" />
</SettingsItem> -->
</SettingsItemGroup>
<SettingsItemGroup :title="$t('settings.group_wallpaper')">

View File

@@ -77,7 +77,7 @@ export const settings = useStorageLocal('settings', ref<Settings>({
searchPageWallpaperMode: 'buildIn',
searchPageWallpaper: '',
searchPageEnableWallpaperMasking: false,
searchPageWallpaperMaskOpacity: 0,
searchPageWallpaperMaskOpacity: 0.6,
searchPageWallpaperBlurIntensity: 0,
recommendationMode: 'web',