-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
62 lines (59 loc) · 1.81 KB
/
index.html
File metadata and controls
62 lines (59 loc) · 1.81 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="A clean and elegant X (Twitter) timeline aggregator" />
<title>X-Line - X Timeline Aggregator</title>
<script>
(function() {
try {
const stored = localStorage.getItem('theme');
let theme = 'system';
if (stored) {
try {
// useLocalStorage 使用 JSON.stringify,所以需要解析
theme = JSON.parse(stored);
} catch (e) {
// 如果不是 JSON 格式,直接使用原始值(向后兼容)
theme = stored;
}
}
let resolvedTheme = theme;
if (theme === 'system') {
resolvedTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
if (resolvedTheme === 'dark') {
document.documentElement.classList.add('dark');
document.documentElement.style.colorScheme = 'dark';
} else {
document.documentElement.style.colorScheme = 'light';
}
} catch (e) {
// Ignore errors
}
})();
</script>
<style>
html {
color-scheme: light dark;
}
html.dark {
color-scheme: dark;
}
body {
background-color: #ffffff;
color: #0f172a;
}
html.dark body {
background-color: #15202b;
color: #e7e9ea;
}
</style>
</head>
<body class="min-h-screen bg-[var(--background)] text-[var(--foreground)]">
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>