🐛 Bug fixes

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

View File

@ -26,6 +26,7 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"sass": "^1.70.0", "sass": "^1.70.0",
"tailwindcss": "^3.4.1", "tailwindcss": "^3.4.1",
"theme-change": "^2.5.0",
"typescript": "^5.3.3" "typescript": "^5.3.3"
}, },
"devDependencies": { "devDependencies": {

View File

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

View File

@ -14,9 +14,16 @@ function Video({ url, ...rest }: { url: string, className?: string }) {
url: url, url: url,
setting: true, setting: true,
flip: true, flip: true,
loop: true,
playbackRate: true, playbackRate: true,
aspectRatio: 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}</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 /> <ViewTransitions />
</head> </head>
<body> <body>
@ -53,6 +64,11 @@ const { title } = Astro.props;
} }
</style> </style>
<script>
import { themeChange } from "theme-change";
themeChange();
</script>
<script <script
async async
src="https://analytics.smartsheep.studio/script.js" src="https://analytics.smartsheep.studio/script.js"

View File

@ -3813,6 +3813,11 @@ tar-stream@^3.1.5:
fast-fifo "^1.2.0" fast-fifo "^1.2.0"
streamx "^2.15.0" streamx "^2.15.0"
theme-change@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/theme-change/-/theme-change-2.5.0.tgz#d3b064af9c4cd01ab16ce0a4ecb251c827a50e68"
integrity sha512-B/UdsgdHAGhSKHTAQnxg/etN0RaMDpehuJmZIjLMDVJ6DGIliRHGD6pODi1CXLQAN9GV0GSyB3G6yCuK05PkPQ==
thenify-all@^1.0.0: thenify-all@^1.0.0:
version "1.6.0" version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"