Capital/src/layouts/RootLayout.astro
2024-01-27 19:46:26 +08:00

78 lines
1.6 KiB
Plaintext

---
import "../assets/fonts/fonts.css";
import Navbar from "../components/Navbar.astro";
import { ViewTransitions } from "astro:transitions";
const { title } = Astro.props;
---
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
{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>
<!-- Header -->
<Navbar />
<!-- Content -->
<main transition:animate="slide">
<slot />
</main>
<!-- Styles -->
<style>
html {
overflow-x: hidden !important;
overflow-y: auto !important;
}
</style>
<style is:global>
.h-fullpage {
height: calc(100vh - 64px);
}
.max-h-fullpage {
max-height: calc(100vh - 64px);
}
.mt-header {
margin-top: 64px;
}
.top-header {
top: 64px;
}
</style>
<script>
import { themeChange } from "theme-change";
themeChange();
</script>
<script
async
src="https://analytics.smartsheep.studio/script.js"
data-website-id="9d676a27-b473-44a3-b444-5a7d851e31e8"></script>
</body>
</html>