forked from GEORGEWWWU/NetSpeed-Dynamic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
52 lines (44 loc) · 1.2 KB
/
Copy pathindex.html
File metadata and controls
52 lines (44 loc) · 1.2 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NetSpeed Dynamic</title>
<style>
html,
body {
margin: 0;
padding: 0;
/* 预设一个平滑过渡 */
transition: background-color 0.3s ease, color 0.3s ease;
}
/* 亮色模式默认底色 */
html {
background-color: #f8fafc;
}
/* 暗色模式覆盖底色 */
html.dark-theme {
background-color: #1e2021;
}
/* 让 body 永远透明,完全透出 html 的颜色 */
body {
background-color: transparent !important;
}
</style>
<script>
(function () {
const theme = localStorage.getItem('nsd_theme_mode') || 'light';
if (theme === 'dark' || (theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
document.documentElement.classList.add('dark-theme');
} else {
document.documentElement.classList.remove('dark-theme');
}
})();
</script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>