-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.html
41 lines (40 loc) · 1.28 KB
/
app.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/lua-logo-favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="preload"
href="https://fonts.nickmazuk.com/inter-variable.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="https://fonts.nickmazuk.com/inter-variable-italic.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
%svelte.head%
</head>
<body>
<div id="svelte">%svelte.body%</div>
</body>
<script>
const setTheme = () => {
const savedTheme = localStorage.getItem('theme')
if (!savedTheme) localStorage.setItem('theme', 'system')
const { classList } = document.body
if (savedTheme === 'system' || !savedTheme) {
const isDark = window.matchMedia('(prefers-color-scheme: dark)').matches
if (isDark) classList.add('dark')
} else if (savedTheme === 'dark') {
classList.add('dark')
}
}
setTheme()
</script>
</html>