diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/header.html | 12 | ||||
-rw-r--r-- | templates/navbar.html | 3 |
2 files changed, 12 insertions, 3 deletions
diff --git a/templates/header.html b/templates/header.html index b7260a5..1bf6219 100644 --- a/templates/header.html +++ b/templates/header.html @@ -11,3 +11,15 @@ <link rel="apple-touch-icon" sizes="152x152" href="/static/icons/icon-152x152.png"> <link rel="apple-touch-icon" sizes="167x167" href="/static/icons/icon-167x167.png"> <link href="/static/v0/css/light.min.css" id="theme" rel="stylesheet"> + +<script> + function addStyleSheet(name, id) { + const path = "/static/v0/css/" + name + ".min.css"; + const old = document.getElementById(id); + if (old && (old.href != path)) { + old.href = path; + } + } + const currentTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; + addStyleSheet(currentTheme, 'theme'); +</script> diff --git a/templates/navbar.html b/templates/navbar.html index da217a9..2fc49ec 100644 --- a/templates/navbar.html +++ b/templates/navbar.html @@ -7,9 +7,6 @@ <span class="main">{{ title }}</span> {% endif %} <ul id="nav-mobile" style="float: right;"> - <li class="waves-effect waves-light"> - <a onClick="javascript:toggleTheme()"><i class="material-icons" aria-label="Farbschema invertieren">invert_colors</i></a> - </li> <li><a href="/"><i class="material-icons" aria-label="Stationen in der Umgebung suchen">my_location</i></a></li> </ul> </div> |