forked from ourongxing/newsnow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (31 loc) · 1.04 KB
/
index.html
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/icon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Elegant reading of real-time and hottest news" />
<meta name="theme-color" content="#F14D42" />
<link rel="preload" href="/Baloo2-Bold.subset.ttf" as="font" type="font/ttf" crossorigin>
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
<script>
function safeParseString(str) {
try {
return JSON.parse(str)
} catch {
return ""
}
}
const theme = safeParseString(localStorage.getItem("color-scheme")) || "auto"
const isDark = window.matchMedia("(prefers-color-scheme: dark)").matches
if (theme === "auto" ? isDark : theme === "dark") {
document.documentElement.classList.add("dark")
}
</script>
<title>NewsNow</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/app.tsx"></script>
</body>
</html>