diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index 432c9c6b..f76f7039 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -55,13 +55,41 @@ const momentsPopRef = ref() const scrollTop = ref(0) const oldScrollTop = ref(0) -const isSearchPage = computed(() => { +const isSearchPage = computed((): boolean => { if (/https?:\/\/search.bilibili.com\/.*$/.test(location.href)) return true return false }) -const showSearchBar = computed(() => { +// 當使用背景時,強制 icon 變白色用於區分背景 +const forceWhiteIcon = computed((): boolean => { + if (!isHomePage()) + return false + if (activatedPage.value === AppPage.Search) { + if (settings.value.individuallySetSearchPageWallpaper) { + if (settings.value.searchPageWallpaper) + return true + return false + } + return !!settings.value.wallpaper + } + else { + if (settings.value.wallpaper) { + return true + } + else { + if (settings.value.useSearchPageModeOnHomePage) { + if (settings.value.individuallySetSearchPageWallpaper && !!settings.value.searchPageWallpaper) + return true + else if (settings.value.wallpaper) + return true + } + } + return false + } +}) + +const showSearchBar = computed((): boolean => { if (isHomePage()) { if (settings.value.useOriginalBilibiliHomepage) return true @@ -77,7 +105,7 @@ const showSearchBar = computed(() => { return true }) -const isTopBarFixed = computed(() => { +const isTopBarFixed = computed((): boolean => { if ( (isHomePage() && settings.value.useOriginalBilibiliHomepage) // video page @@ -96,7 +124,7 @@ const isTopBarFixed = computed(() => { return false }) -const showTopBar = computed(() => { +const showTopBar = computed((): boolean => { const isCreativeCenter = /https?:\/\/member.bilibili.com\/platform.*/.test(location.href) if (settings.value.showTopBar && !isCreativeCenter) return true @@ -123,16 +151,6 @@ function closeAllTopBarPopup(exceptionKey?: keyof typeof popupVisible) { }) } -const rightSideInactive = computed(() => { - let isInactive = false - Object.entries(popupVisible).forEach(([_key, value]) => { - if (value) { - isInactive = true - } - }) - return isInactive -}) - // Channels const channels = setupTopBarItemHoverEvent('channels') // Avatar @@ -411,20 +429,24 @@ defineExpose({
@@ -437,20 +459,20 @@ defineExpose({