-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
61 lines (61 loc) · 2.01 KB
/
index.html
File metadata and controls
61 lines (61 loc) · 2.01 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
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>skyImage</title>
<script>
(function () {
try {
var cachedConfig = localStorage.getItem("skyimage-site-config");
if (cachedConfig) {
var config = JSON.parse(cachedConfig);
if (config.title) {
document.title = config.title;
}
if (config.logo) {
var rawLogo = String(config.logo).trim();
var logo = rawLogo;
if (!/^(https?:)?\/\//i.test(logo) && !logo.startsWith("data:") && !logo.startsWith("/")) {
logo = "/" + logo;
}
var favicon = document.querySelector("link[rel='icon']");
if (favicon) {
favicon.setAttribute("href", logo + (logo.indexOf("?") >= 0 ? "&" : "?") + "v=" + encodeURIComponent(rawLogo));
}
}
}
} catch (error) {
console.warn("title init failed", error);
}
})();
</script>
<script>
(function () {
try {
var storageKey = "skyimage-theme";
var stored = localStorage.getItem(storageKey);
var systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
var resolved =
stored === "light" || stored === "dark"
? stored
: systemPrefersDark
? "dark"
: "light";
if (resolved === "dark") {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
} catch (error) {
console.warn("theme init failed", error);
}
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>