-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (48 loc) · 1.69 KB
/
index.html
File metadata and controls
48 lines (48 loc) · 1.69 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>XCoding</title>
<script>
(() => {
try {
const root = document.documentElement;
const raw = localStorage.getItem("xcoding.lastThemeCssVars");
if (raw) {
const parsed = JSON.parse(raw);
const cssVars = parsed?.cssVars;
const appearance = parsed?.appearance;
if (appearance === "dark" || appearance === "light") {
root.dataset.theme = appearance;
root.style.colorScheme = appearance;
}
if (cssVars && typeof cssVars === "object") {
for (const [k, v] of Object.entries(cssVars)) {
if (typeof k === "string" && k.startsWith("--")) root.style.setProperty(k, String(v ?? ""));
}
const bg = cssVars["--vscode-editor-background"] || cssVars["--aurora-base"];
if (bg) {
root.style.backgroundColor = bg;
document.body && (document.body.style.backgroundColor = bg);
}
}
} else {
const bg = localStorage.getItem("xcoding.lastThemeBg");
if (bg) {
root.style.backgroundColor = bg;
root.style.setProperty("--vscode-editor-background", bg);
document.body && (document.body.style.backgroundColor = bg);
}
}
} catch {
/* ignore */
}
})();
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/renderer/main.tsx"></script>
</body>
</html>