newsnow/index.html

41 lines
1.4 KiB
HTML
Raw Permalink Normal View History

2024-09-26 11:30:21 +08:00
<!doctype html>
<html lang="en">
2024-10-20 01:30:10 +08:00
<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>
2024-10-20 01:30:10 +08:00
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
<script>
function safeParseString(str) {
try {
return JSON.parse(str)
} catch {
return ""
2024-10-19 13:15:48 +08:00
}
2024-10-20 01:30:10 +08:00
}
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")
}
2024-11-03 21:13:21 +08:00
const query = new URLSearchParams(window.location.search)
if (query.has("login") && query.has("user") && query.has("jwt")) {
localStorage.setItem("user", query.get("user"))
localStorage.setItem("jwt", JSON.stringify(query.get("jwt")))
window.history.replaceState({}, document.title, window.location.pathname)
}
2024-10-20 01:30:10 +08:00
</script>
<title>NewsNow</title>
</head>
<body>
<div id="app"></div>
2024-10-30 00:15:24 +08:00
<script type="module" src="/src/main.tsx"></script>
2024-10-20 01:30:10 +08:00
</body>
</html>