diff options
Diffstat (limited to 'apps/portal/src/index.html')
| -rw-r--r-- | apps/portal/src/index.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/portal/src/index.html b/apps/portal/src/index.html index 0bf1fb1..25de7d3 100644 --- a/apps/portal/src/index.html +++ b/apps/portal/src/index.html @@ -26,16 +26,23 @@ <link rel="icon" href="./_assets/pwa/favicon.svg"> <script> - const currentTheme = localStorage.getItem("theme"); + 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 { + } 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> <link rel="stylesheet" href="./_assets/pre.css"> - <title>Projects - Greatoffice</title> + <title>Portal - Greatoffice</title> </head> <body> @@ -47,7 +54,7 @@ <div class="fill-loader fill-loader--v4" id="loader" role="alert"> - <p class="fill-loader__label">Loading Projects...</p> + <p class="fill-loader__label">Loading Portal...</p> <div aria-hidden="true"> <div class="fill-loader__base"></div> <div class="fill-loader__fill"></div> |
