-
Notifications
You must be signed in to change notification settings - Fork 327
Expand file tree
/
Copy pathindex.html
More file actions
45 lines (43 loc) · 1.95 KB
/
Copy pathindex.html
File metadata and controls
45 lines (43 loc) · 1.95 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
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
/>
<meta name="theme-color" content="#000000" />
<link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<title>Thunderbolt</title>
</head>
<body>
<script>
// Apply theme before first paint to prevent flash of white on dark mode.
// Must stay in sync with the storageKey and logic in src/stores/local-settings-store.ts.
// The colors mirror --color-background in src/index.css — this is the one
// unavoidable duplicate of those values (this script runs before the
// stylesheet loads; theme-provider.tsx reads them from CSS at runtime).
;(function () {
var theme = null
try {
var raw = localStorage.getItem('thunderbolt-local-settings')
if (raw) {
theme = JSON.parse(raw).state.theme
}
} catch (e) {}
var isDark = theme === 'dark' || (theme !== 'light' && matchMedia('(prefers-color-scheme: dark)').matches)
document.documentElement.classList.add(isDark ? 'dark' : 'light')
document.documentElement.style.backgroundColor = isDark ? '#1b1e1f' : '#f5f2ee'
document.querySelector('meta[name="theme-color"]')?.setAttribute('content', isDark ? '#1b1e1f' : '#f5f2ee')
})()
</script>
<div id="root"></div>
<script src="/src/index.tsx" type="module"></script>
</body>
</html>