-
-
Notifications
You must be signed in to change notification settings - Fork 914
Expand file tree
/
Copy pathbase.tsx
More file actions
69 lines (64 loc) · 2.13 KB
/
base.tsx
File metadata and controls
69 lines (64 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { version } from "../../package.json";
export const BaseHtml = ({
children,
title = "ConvertX",
webroot = "",
}: {
children: JSX.Element;
title?: string;
webroot?: string;
}) => (
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="webroot" content={webroot} />
<title safe>{title}</title>
{/*
Apply the persisted theme as early as possible to avoid a flash.
- If no preference is stored, tokens fall back to OS preference via CSS.
*/}
<script>
{`
(() => {
const KEY = 'convertx-theme';
try {
const v = localStorage.getItem(KEY);
if (v === 'dark' || v === 'light') {
document.documentElement.setAttribute('data-theme', v);
document.documentElement.style.colorScheme = v;
}
} catch {
// ignore
}
})();
`}
</script>
<link rel="stylesheet" href={`${webroot}/generated.css`} />
{/* Theme toggle behavior (syncs the header switch + persists choice). */}
<script src={`${webroot}/theme.js`} defer />
<link rel="apple-touch-icon" sizes="180x180" href={`${webroot}/apple-touch-icon.png`} />
<link rel="icon" type="image/png" sizes="32x32" href={`${webroot}/favicon-32x32.png`} />
<link rel="icon" type="image/png" sizes="16x16" href={`${webroot}/favicon-16x16.png`} />
<link rel="manifest" href={`${webroot}/site.webmanifest`} />
</head>
<body class={`flex min-h-screen w-full flex-col bg-neutral-900 text-neutral-200`}>
{children}
<footer class="w-full">
<div class="p-4 text-center text-sm text-neutral-500">
<span>Powered by </span>
<a
href="https://github.com/C4illin/ConvertX"
class={`
text-neutral-400
hover:text-accent-500
`}
>
ConvertX{" "}
</a>
<span safe>v{version || ""}</span>
</div>
</footer>
</body>
</html>
);