2026-06-05 14:31:12 -06:00
|
|
|
---
|
|
|
|
|
//import "../global.css";
|
|
|
|
|
import Header from "../components/Header.astro";
|
|
|
|
|
import Footer from "../components/Footer.astro";
|
|
|
|
|
|
|
|
|
|
import { urlfrag } from "../utils/path.js";
|
|
|
|
|
|
|
|
|
|
const { title } = Astro.props;
|
|
|
|
|
const base = import.meta.env.BASE_URL;
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
<!doctype html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<link rel="icon" type="image/svg+xml" href={urlfrag(base, 'favicon.svg')} />
|
|
|
|
|
<link rel="icon" href={urlfrag(base, 'favicon.png')} />
|
|
|
|
|
<meta name="generator" content={Astro.generator} />
|
|
|
|
|
<title>{title}</title>
|
2026-06-22 15:03:55 -06:00
|
|
|
<script>
|
|
|
|
|
document.documentElement.classList.toggle(
|
|
|
|
|
"dark",
|
|
|
|
|
localStorage.theme === "dark" ||
|
|
|
|
|
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches),
|
|
|
|
|
);
|
|
|
|
|
const toggle = document.querySelectorAll('[data-toggle-theme]');
|
|
|
|
|
toggle.forEach((b) => {
|
|
|
|
|
b.addEventListener('click', () => {
|
|
|
|
|
console.log(b.attributes);
|
|
|
|
|
const theme: string = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
|
|
|
|
if (theme === 'undefined' || theme === '' || theme === 'light') {
|
|
|
|
|
document.documentElement.classList.toggle('dark');
|
|
|
|
|
localStorage.theme = 'dark';
|
|
|
|
|
} else {
|
|
|
|
|
document.documentElement.classList.remove('dark');
|
|
|
|
|
localStorage.theme = 'light';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2026-06-05 14:31:12 -06:00
|
|
|
</head>
|
|
|
|
|
<body class="flex flex-col min-h-screen">
|
|
|
|
|
<Header />
|
|
|
|
|
<main class="grow">
|
|
|
|
|
<slot />
|
|
|
|
|
</main>
|
|
|
|
|
<Footer />
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|