From d6b079ce1eebd0cdb53c64a29d29125dfc97a668 Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 19 Nov 2023 17:07:36 +0800 Subject: [PATCH] Fix styles in history page (fix #4459) --- registry/lib/components/style/custom-navbar/entry.ts | 4 ++++ .../lib/components/style/custom-navbar/hide-original.scss | 5 ++++- .../lib/components/style/custom-navbar/transparent-fill.ts | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/registry/lib/components/style/custom-navbar/entry.ts b/registry/lib/components/style/custom-navbar/entry.ts index d6dc4fa10..3646458d0 100644 --- a/registry/lib/components/style/custom-navbar/entry.ts +++ b/registry/lib/components/style/custom-navbar/entry.ts @@ -43,6 +43,10 @@ export const entry: ComponentEntry = async ({ metadata: { name } }) => { true, ) } + // https://github.com/the1812/Bilibili-Evolved/issues/4459 + if (matchUrlPattern('https://www.bilibili.com/account/history')) { + document.body.classList.add('history-page') + } const CustomNavbar = await import('./CustomNavbar.vue') const customNavbar: Vue & { styles: string[] diff --git a/registry/lib/components/style/custom-navbar/hide-original.scss b/registry/lib/components/style/custom-navbar/hide-original.scss index 66522684c..9a970c9f6 100644 --- a/registry/lib/components/style/custom-navbar/hide-original.scss +++ b/registry/lib/components/style/custom-navbar/hide-original.scss @@ -32,10 +32,13 @@ li.nav-item[report-id="playpage_dynamic"] .i-frame, height: var(--navbar-height) !important; } #message-navbar, -#biliMainHeader:not(.z-top-container), +body:not(.history-page) #biliMainHeader:not(.z-top-container), .z-top-container:not(#biliMainHeader) { max-height: var(--navbar-height) !important; } +body.history-page #biliMainHeader:not(.z-top-container) { + height: auto; +} .link-top-container#tab-container { top: var(--navbar-height) !important; } diff --git a/registry/lib/components/style/custom-navbar/transparent-fill.ts b/registry/lib/components/style/custom-navbar/transparent-fill.ts index 7cc60525d..eb867902d 100644 --- a/registry/lib/components/style/custom-navbar/transparent-fill.ts +++ b/registry/lib/components/style/custom-navbar/transparent-fill.ts @@ -27,6 +27,9 @@ export const checkTransparentFill = async (vm: { if ((banner as HTMLVideoElement | HTMLImageElement).src) { return true } + if (banner.querySelector('.animated-banner')) { + return true + } return false } if (banners.some(hasBannerImage)) {