chore: just wanna add some code

This commit is contained in:
Hakadao
2023-03-15 23:51:32 +08:00
parent 50a72e2278
commit bb148f1f2b
3 changed files with 40 additions and 25 deletions

View File

@@ -65,21 +65,40 @@ browser.tabs.onUpdated.addListener((tabId: number, changInfo: Tabs.OnUpdatedChan
})
if (changInfo.status === 'loading') {
const css = `
body {
opacity: 0;
transition: opacity 0.5s;
overflow-y: hidden;
pointer-events: none;
}
`
// const css = `
// body {
// opacity: 0;
// transition: opacity 0.5s;
// overflow-y: hidden;
// pointer-events: none;
// }
// `
browser.scripting.insertCSS({
css,
css: `
body {
opacity: 0;
transition: opacity 0.5s;
overflow-y: hidden;
pointer-events: none;
}
`,
target: {
tabId,
},
})
setTimeout(() => {
browser.scripting.insertCSS({
css: `
body {
opacity: 1;
overflow-y: auto;
pointer-events: auto;
}
`,
target: { tabId },
})
}, 1500)
// If it not a macOS, we will inject CSS to design the scrollbar
if (!navigator.userAgent.includes('Mac OS X')) {
@@ -114,18 +133,18 @@ browser.tabs.onUpdated.addListener((tabId: number, changInfo: Tabs.OnUpdatedChan
}
}
else if (changInfo.status === 'complete') {
const css = `
body {
opacity: 1;
overflow-y: auto;
pointer-events: auto;
}
`
// const css = `
// body {
// opacity: 1;
// overflow-y: auto;
// pointer-events: auto;
// }
// `
browser.scripting.insertCSS({
css,
target: { tabId },
})
// browser.scripting.insertCSS({
// css,
// target: { tabId },
// })
}
}
})

View File

@@ -65,7 +65,7 @@ async function setAppLanguage() {
</script>
<template>
<div bg="$bew-bg" text="$bew-text-1">
<div bg="$bew-bg" text="$bew-text-1" min-h-100vh>
<div m-auto max-w="$bew-page-max-width">
<Transition name="topbar">
<Topbar

View File

@@ -13,10 +13,6 @@ html, body {
// padding: 0;
// }
#bewly {
background-color: var(--bew-bg);
}
// html {
// filter: none !important;
// }