-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
30 lines (29 loc) · 1022 Bytes
/
Copy pathindex.html
File metadata and controls
30 lines (29 loc) · 1022 Bytes
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/svg+xml" href="%BASE_URL%favicon.svg" />
<script>
(() => {
const storageKey = 'only-tools-web:theme'
let theme = 'system'
try {
const savedTheme = localStorage.getItem(storageKey)
if (savedTheme === 'light' || savedTheme === 'dark') {
theme = savedTheme
}
} catch {}
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches
const isDark = theme === 'dark' || (theme === 'system' && prefersDark)
document.documentElement.classList.toggle('dark', isDark)
document.documentElement.style.colorScheme = isDark ? 'dark' : 'light'
})()
</script>
<title>Only Tools Web</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>