fix theme icon button
change icon on button by default dark theme
This commit is contained in:
parent
871188fcbe
commit
3bc6a237a3
11
index.html
11
index.html
|
@ -9,8 +9,8 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<title>Hangman</title>
|
<title>WORDs</title>
|
||||||
<meta name="apple-mobile-web-app-title" content="Hangman">
|
<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">
|
<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">
|
<link rel="stylesheet" href="https://unpkg.com/chota@0.8.0">
|
||||||
<!-- dev mode -->
|
<!-- dev mode -->
|
||||||
|
@ -26,14 +26,14 @@
|
||||||
<header>
|
<header>
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<div class="nav-left">
|
<div class="nav-left">
|
||||||
<a class="brand" href="#">Hangman game</a>
|
<a class="brand" href="#">WORDs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-center">
|
<div class="nav-center">
|
||||||
<p id="lives" class="button error">loading...</p>
|
<p id="lives" class="button error">loading...</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="nav-right">
|
<div class="nav-right">
|
||||||
<a class="button dropdown">Язык</a>
|
<!-- <a class="button dropdown">Language</a> -->
|
||||||
<a class="button dark" id="theme-switch" onclick="switchMode(this)">☀️</a>
|
<a class="button clear" id="theme-switch" onclick="switchMode(this)">☀️</a>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
@ -69,6 +69,7 @@
|
||||||
if (window.matchMedia &&
|
if (window.matchMedia &&
|
||||||
window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
document.body.classList.add('dark');
|
document.body.classList.add('dark');
|
||||||
|
document.querySelector("#theme-switch").innerHTML = "🌙";
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchMode(el) {
|
function switchMode(el) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user