-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (41 loc) · 1.57 KB
/
index.html
File metadata and controls
43 lines (41 loc) · 1.57 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pebble Prototype</title>
<script>
;(() => {
const storageKey = 'pebble.theme.v1'
const legacyStorageKey = 'pebble_theme'
const root = document.documentElement
try {
const saved = window.localStorage.getItem(storageKey) ?? window.localStorage.getItem(legacyStorageKey)
const systemPrefersLight = window.matchMedia('(prefers-color-scheme: light)').matches
const nextTheme =
saved === 'dark' || saved === 'light'
? saved
: systemPrefersLight
? 'light'
: 'dark'
root.classList.add(nextTheme === 'light' ? 'theme-light' : 'theme-dark')
root.setAttribute('data-theme', nextTheme)
root.style.colorScheme = nextTheme
window.localStorage.setItem(storageKey, nextTheme)
} catch {
root.classList.add('theme-dark')
root.setAttribute('data-theme', 'dark')
root.style.colorScheme = 'dark'
}
})()
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>