-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathindex.html
35 lines (31 loc) · 846 Bytes
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script>
function checkDarkMode() {
const query = "(prefers-color-scheme: dark)"
/**
* @param {MediaQueryListEvent} e
*/
const onChange = (e) => {
if (e.matches) {
document.documentElement.classList.add("dark")
} else {
document.documentElement.classList.remove("dark")
}
}
const mql = window.matchMedia(query)
onChange(mql)
mql.addEventListener("change", onChange)
}
checkDarkMode()
</script>
</head>
<body>
<div id="root"></div>
<div id="modal-container"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>