-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
46 lines (45 loc) · 1.79 KB
/
Copy pathindex.html
File metadata and controls
46 lines (45 loc) · 1.79 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="%BASE_URL%favicon.svg" type="image/svg+xml" />
<link rel="manifest" href="%BASE_URL%manifest.webmanifest" crossorigin="use-credentials" />
<link rel="apple-touch-icon" href="%BASE_URL%icons/apple-touch-icon.png" />
<meta name="theme-color" content="#f5f7fb" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<script>
(() => {
const storageKey = "yard-theme-mode"
const colors = {
light: "#f5f7fb",
dark: "#111821",
vivid: "#ffd3bf",
}
let storedMode = null
try {
storedMode = window.localStorage.getItem(storageKey)
} catch {
storedMode = null
}
const mode =
storedMode === "light" || storedMode === "dark" || storedMode === "vivid" || storedMode === "system"
? storedMode
: "system"
const systemTheme = window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light"
const resolvedTheme = mode === "system" ? systemTheme : mode
const themeColorMeta = document.querySelector('meta[name="theme-color"]')
document.documentElement.dataset.theme = resolvedTheme
document.documentElement.style.colorScheme = resolvedTheme === "dark" ? "dark" : "light"
themeColorMeta?.setAttribute("content", colors[resolvedTheme])
})()
</script>
<title>YARD</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>