-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
64 lines (63 loc) · 1.88 KB
/
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
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
63
64
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
<script>
window.global = window
;(function () {
// https://github.com/jjranalli/nightwind/pull/57/files
function getInitialColorMode() {
const persistedColorPreference =
window.localStorage.getItem('nightwind-mode')
const hasPersistedPreference =
typeof persistedColorPreference === 'string'
if (hasPersistedPreference) {
return persistedColorPreference
}
const mql = window.matchMedia('(prefers-color-scheme: dark)')
const hasMediaQueryPreference = typeof mql.matches === 'boolean'
if (hasMediaQueryPreference) {
return mql.matches ? 'dark' : 'light'
}
return 'light'
}
function setTheme() {
getInitialColorMode() == 'light'
? document.documentElement.classList.remove('dark')
: document.documentElement.classList.add('dark')
}
window
.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', setTheme)
setTheme()
})()
</script>
<!-- grep 3FBCE1B6-ABA3-4179-80B3-A965F8D087BC -->
<script type="importmap">
{
"imports": {
"solid-js": "%solidPath%",
"solid-js/web": "%solidWebPath%",
"solid-js/store": "%solidStorePath%",
"@solidjs/router": "%solidRouterPath%"
}
}
</script>
<style>
@media (prefers-color-scheme: dark) {
:root {
background-color: black;
}
}
</style>
<title>Pentive App</title>
</head>
<body class="text-gray-700 bg-gray-100">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root" class="flex h-full flex-col"></div>
<script src="/src/index.tsx" type="module"></script>
</body>
</html>