fix theme icon button

change icon on button by default dark theme
This commit is contained in:
Alexander Popov 2021-02-25 04:03:39 +03:00
parent 871188fcbe
commit 3bc6a237a3
Signed by: iiiypuk
GPG Key ID: 398FC73478D97286

View File

@ -9,8 +9,8 @@
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<title>Hangman</title>
<meta name="apple-mobile-web-app-title" content="Hangman">
<title>WORDs</title>
<meta name="apple-mobile-web-app-title" content="WORDs">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimal-ui">
<link rel="stylesheet" href="https://unpkg.com/chota@0.8.0">
<!-- dev mode -->
@ -26,14 +26,14 @@
<header>
<nav class="nav">
<div class="nav-left">
<a class="brand" href="#">Hangman game</a>
<a class="brand" href="#">WORDs</a>
</div>
<div class="nav-center">
<p id="lives" class="button error">loading...</p>
</div>
<div class="nav-right">
<a class="button dropdown">Язык</a>
<a class="button dark" id="theme-switch" onclick="switchMode(this)">☀️</a>
<!-- <a class="button dropdown">Language</a> -->
<a class="button clear" id="theme-switch" onclick="switchMode(this)">☀️</a>
</div>
</nav>
</header>
@ -69,6 +69,7 @@
if (window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
document.querySelector("#theme-switch").innerHTML = "🌙";
}
function switchMode(el) {