forked from glink25/Cent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
67 lines (64 loc) · 2.74 KB
/
Copy pathindex.html
File metadata and controls
67 lines (64 loc) · 2.74 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#fff" />
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#fff" />
<!-- <link rel="apple-touch-icon-precomposed" sizes="256x256" href="/icon.png" /> -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
href="https://s3.bmp.ovh/imgs/2022/10/23/85185ded3707afb9.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Cent" />
<meta name="msapplication-TileColor" content="#000000" />
<meta name="viewport"
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
<link rel="icon" href="/favicon.ico" />
<title>Cent</title>
<%- VITE_GTAG_SCRIPT %>
<script>
// handle login authorized
// github login
if (location.href.includes("github_authorized")) {
localStorage.setItem("_oauth_res", JSON.stringify({ type: "github", url: location.href }));
localStorage.setItem("SYNC_ENDPOINT", "github");
setTimeout(() => {
location.replace(window.origin);
}, 1);
} else if (location.href.includes("gitee_authorized")) {
localStorage.setItem("_oauth_res", JSON.stringify({ type: "gitee", url: location.href }));
localStorage.setItem("SYNC_ENDPOINT", "gitee");
setTimeout(() => {
location.replace(window.origin);
}, 1);
}
</script>
<script>
(function () {
try {
const stored = localStorage.getItem("theme"); // 'dark' | 'light' | 'system' | null
if (stored === "dark") {
document.documentElement.classList.add("dark");
} else if (stored === "light") {
document.documentElement.classList.remove("dark");
} else {
// 没有显式偏好,按系统决定
const prefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
if (prefersDark) document.documentElement.classList.add("dark");
else document.documentElement.classList.remove("dark");
}
} catch (e) {
// localStorage 可能被禁用,安全降级:按系统
const prefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
if (prefersDark) document.documentElement.classList.add("dark");
}
})();
</script>
<script><%- injectPresetScript %></script>
</head>
<body tabindex="1" class="custom-css-body">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>