summaryrefslogtreecommitdiffstats
path: root/apps/frontpage/src/app.html
blob: e46fbe31a23ddb3a54db0864d52a3e2e073e4398 (plain) (blame)
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <link rel="icon"
        href="%sveltekit.assets%/favicon.png"/>
  <link rel="stylesheet"
        href="%sveltekit.assets%/pre.css"/>
  <script>
    const value = `; ${document.cookie}`;
    const parts = value.split(`; go_theme=`);
    let currentTheme = "system";
    if (parts.length === 2) {
      currentTheme = parts.pop().split(";").shift();
    }
    if (currentTheme === "light") {
      document.querySelector("html").dataset.theme = "light";
    } else if (currentTheme === "dark") {
      document.querySelector("html").dataset.theme = "dark";
    } else {
      document.querySelector("html").dataset.theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
    }
  </script>
  <meta name="viewport"
        content="width=device-width, initial-scale=1"/>
  %sveltekit.head%
</head>
<body>
<div>%sveltekit.body%</div>
</body>
</html>