diff --git a/src/components/IframeDrawer.vue b/src/components/IframeDrawer.vue index bf18b57f..071a97bf 100644 --- a/src/components/IframeDrawer.vue +++ b/src/components/IframeDrawer.vue @@ -30,11 +30,11 @@ nextTick(() => { useEventListener(iframeRef.value?.contentWindow, 'DOMContentLoaded', () => { if (headerShow.value) { - iframeRef.value?.contentWindow?.document.documentElement.classList.add('remove-bili-top-bar-without-placeholder') + iframeRef.value?.contentWindow?.document.documentElement.classList.add('remove-top-bar-without-placeholder') removeTopBarClassInjected.value = true } else { - iframeRef.value?.contentWindow?.document.documentElement.classList.remove('remove-bili-top-bar-without-placeholder') + iframeRef.value?.contentWindow?.document.documentElement.classList.remove('remove-top-bar-without-placeholder') removeTopBarClassInjected.value = false } }) @@ -250,7 +250,7 @@ watchEffect(() => { ref="iframeRef" :src="props.url" :style="{ - // Prevent top bar shaking when before the remove-bili-top-bar-without-placeholder class is injected + // Prevent top bar shaking when before the remove-top-bar-without-placeholder class is injected top: !removeTopBarClassInjected ? `calc(-1 * var(--bew-top-bar-height))` : '0', }" frameborder="0" diff --git a/src/contentScripts/views/necessarySettingsWatchers.ts b/src/contentScripts/views/necessarySettingsWatchers.ts index a7c12b3d..e3a8651c 100644 --- a/src/contentScripts/views/necessarySettingsWatchers.ts +++ b/src/contentScripts/views/necessarySettingsWatchers.ts @@ -259,7 +259,7 @@ export function setupNecessarySettingsWatchers() { (newVal) => { if (newVal) settings.value.showTopBar = false - document.documentElement.classList.toggle('remove-bili-top-bar', !settings.value.useOriginalBilibiliTopBar) + document.documentElement.classList.toggle('remove-top-bar', !settings.value.useOriginalBilibiliTopBar) settings.value.showTopBar = !settings.value.useOriginalBilibiliTopBar }, { immediate: true }, diff --git a/src/styles/index.ts b/src/styles/index.ts index ea8c1b9d..decc60e0 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -3,5 +3,5 @@ import './main.scss' import './adaptedStyles' import './transitionAndTransitionGroup.scss' import './blockAds.scss' -import './removeBiliTopBar.scss' +import './removeTopBar.scss' import './fonts.scss' diff --git a/src/styles/removeBiliTopBar.scss b/src/styles/removeTopBar.scss similarity index 91% rename from src/styles/removeBiliTopBar.scss rename to src/styles/removeTopBar.scss index 9a147e01..b4b74784 100644 --- a/src/styles/removeBiliTopBar.scss +++ b/src/styles/removeTopBar.scss @@ -1,4 +1,4 @@ -.remove-bili-top-bar { +.remove-top-bar { // remove the original top bar and adjust the height of the top bar to match the bewly top bar .bili-header .bili-header__bar, #internationalHeader, @@ -23,7 +23,7 @@ } } -.remove-bili-top-bar-without-placeholder { +.remove-top-bar-without-placeholder { #biliMainHeader { display: none; }