🐛 Bug fixes

This commit is contained in:
2024-01-27 19:46:26 +08:00
parent 6897bfe018
commit 1ad7aed1cd
5 changed files with 31 additions and 4 deletions

View File

@@ -83,9 +83,7 @@ const items: MenuItem[] = [
</ul>
</div>
<div class="navbar-end">
<label class="swap swap-rotate px-[16px]">
<input type="checkbox" class="theme-controller" value="light" checked />
<label class="swap swap-rotate px-[16px]" data-toggle-theme="dark,light" data-act-class="swap-active">
<svg
class="swap-on fill-current w-8 h-8"
xmlns="http://www.w3.org/2000/svg"

View File

@@ -14,9 +14,16 @@ function Video({ url, ...rest }: { url: string, className?: string }) {
url: url,
setting: true,
flip: true,
loop: true,
playbackRate: true,
aspectRatio: true,
subtitleOffset: true
subtitleOffset: true,
fullscreen: true,
fullscreenWeb: true,
screenshot: true,
autoPlayback: true,
airplay: true,
theme: "#49509e",
});
});

View File

@@ -16,6 +16,17 @@ const { title } = Astro.props;
{title && (<title>山羊寒舍 | {title}</title>)}
{!title && (<title>山羊寒舍</title>)}
<script is:inline>
if (localStorage.getItem("theme") === null) {
document.documentElement.setAttribute("data-theme", "light");
} else {
document.documentElement.setAttribute(
"data-theme",
localStorage.getItem("theme")
);
}
</script>
<ViewTransitions />
</head>
<body>
@@ -53,6 +64,11 @@ const { title } = Astro.props;
}
</style>
<script>
import { themeChange } from "theme-change";
themeChange();
</script>
<script
async
src="https://analytics.smartsheep.studio/script.js"