-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
46 lines (39 loc) · 1.53 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spelling Bee</title>
<script charset="utf-8" src="spellingbee.js"></script>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap" rel="stylesheet">
<!-- Arguably "correct", but not very attractive with the current design: -->
<!-- <meta name="theme-color" content="rgb(47, 143, 191)" /> -->
<!--
Setting both light and dark colors works for the most part, on iPhone (iOS 17.2):
- it looks right when the page loads
- if the page is loaded in light mode, and then the mode is switched, it reacts
- if the page is loaded in dark mode, then the theme color is stuck on black
-->
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)" />
</head>
<body>
<main></main>
<script>
var isDark = window.matchMedia("(prefers-color-scheme: dark)");
var entryPoint = Elm.Main || Elm.Demo.Local;
var app = entryPoint.init({
node: document.querySelector('main'),
flags: {
dark: isDark.matches
}
});
if (app.ports.receiveIsDarkPort !== undefined) {
isDark.addListener(() => {
app.ports.receiveIsDarkPort.send(isDark.matches);
});
}
</script>
</body>
</html>