Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
60 lines (60 loc) · 2.58 KB
/
Copy pathindex.html
File metadata and controls
60 lines (60 loc) · 2.58 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
<!doctype html>
<html lang="en" data-theme="dark" data-glass="regular">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GitNapse Desktop</title>
<script>
(function () {
try {
var stored = localStorage.getItem("gitnapse.theme");
var preference = stored === "dark" || stored === "light" ? stored : "system";
var dark =
preference === "dark" ||
(preference === "system" &&
window.matchMedia("(prefers-color-scheme: dark)").matches);
document.documentElement.dataset.theme = dark ? "dark" : "light";
var glass = localStorage.getItem("gitnapse.glass");
if (glass === "thin" || glass === "regular" || glass === "thick") {
document.documentElement.dataset.glass = glass;
}
if (localStorage.getItem("gitnapse.transparency") === "reduce") {
document.documentElement.dataset.transparency = "reduce";
}
var cachedRaw = localStorage.getItem("gitnapse.themeTokens");
if (cachedRaw) {
var cached = JSON.parse(cachedRaw);
if (cached && cached.colors && cached.tokens) {
document.documentElement.dataset.theme = cached.colors.dark ? "dark" : "light";
document.documentElement.dataset.themeName = cached.name;
var keys = [
"--bg", "--surface", "--surface-raised", "--line", "--line-visible",
"--control-line", "--ink-strong", "--ink", "--ink-muted", "--ink-faint",
"--focus-ring", "--scrim", "--texture-ink", "--overlay-surface",
"--selection-bg", "--selection-ink",
"--accent", "--accent-2", "--accent-3",
"--accent-soft", "--accent-2-soft", "--accent-3-soft",
"--glass-tint-rgb",
"--status-ok", "--status-warn", "--status-err", "--status-info",
"--status-ok-subtle", "--status-warn-subtle", "--status-err-subtle",
"--status-info-subtle"
];
for (var i = 0; i < keys.length; i++) {
var value = cached.tokens[keys[i]];
if (value) {
document.documentElement.style.setProperty(keys[i], value);
}
}
}
}
} catch (error) {
document.documentElement.dataset.theme = "dark";
}
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>