This commit is contained in:
not-nullptr 2024-11-15 14:18:57 +00:00
parent adb4bd4fc5
commit 69a4d928d0
2 changed files with 7 additions and 10 deletions

View File

@ -90,16 +90,6 @@
navbar?.addEventListener("mouseenter", mouseEnter);
navbar?.addEventListener("mouseleave", mouseLeave);
});
onMount(() => {
window.plausible =
window.plausible ||
((_, opts) => {
opts?.callback?.({
status: 200,
});
});
});
</script>
<svelte:head>

View File

@ -4,6 +4,13 @@ import JSCookie from "js-cookie";
export const load = ({ data }) => {
if (!browser) return;
window.plausible =
window.plausible ||
((_, opts) => {
opts?.callback?.({
status: 200,
});
});
const themeStr = JSCookie.get("theme");
if (typeof themeStr === "undefined") {
theme.dark = window.matchMedia("(prefers-color-scheme: dark)").matches;