sundays/src/layouts/Layout.astro

63 lines
1.5 KiB
Text
Raw Normal View History

2026-06-05 14:31:12 -06:00
---
//import "../global.css";
import Header from "../components/Header.astro";
import Footer from "../components/Footer.astro";
import Meta from "../components/Meta.astro";
2026-06-05 14:31:12 -06:00
import { urlfrag } from "../utils/path.js";
const { title, image } = Astro.props;
2026-06-05 14:31:12 -06:00
const base = import.meta.env.BASE_URL;
---
<!doctype html>
<html lang="en">
2026-06-05 14:31:12 -06:00
<head>
2026-11-28 09:44:28 -07:00
<script is:inline>
2026-11-29 19:27:16 -07:00
function th() {
var cl = document.documentElement.classList;
af_enabled = 'af_enabled' in localStorage && localStorage.af_enabled === '1' ? true : false;
af_mode = 'af_mode' in localStorage ? localStorage.af_mode : '';
theme = 'theme' in localStorage ? localStorage.theme : '';
if (theme === '' || theme === 'system') {
theme = window.matchMedia('(prefers-color-scheme: dark)') ? 'dark' : 'light';
}
if (af_enabled) {
switch (af_mode) {
case 'df':
cl.add('df');
return;
case 'hc':
cl.add('hc');
break;
}
}
if (theme === 'dark') {
cl.add('dark');
}
}
th();
2026-11-28 09:44:28 -07:00
</script>
2026-06-05 14:31:12 -06:00
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2026-08-06 10:30:42 -06:00
<meta name="theme-color" content="#28303c" />
<Meta title={title} image={image} />
2026-06-05 14:31:12 -06:00
<link rel="icon" type="image/svg+xml" href={urlfrag(base, 'favicon.svg')} />
<link rel="icon" href={urlfrag(base, 'favicon.png')} />
<title>{title}</title>
<script>
2026-11-27 17:42:43 -07:00
import { theme } from '../utils/theme.ts';
theme();
</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>