1
0
forked from javalsai/website

dark/light mode toggle

This commit is contained in:
2024-10-08 23:12:34 +01:00
parent cb7060b5f2
commit 4f6cdf31d4
7 changed files with 38 additions and 9 deletions

View File

@@ -1,10 +1,17 @@
<header>
<nav>
<ul class="row-ul">
<li><a href="/">home</a></li>
<li><a href="https://git.javalsai.dynv6.net/">gitea</a></li>
<li><a href="/tools">tools</a></li>
<li><a href="/notes">notes</a></li>
</ul>
</nav>
<nav>
<ul class="row-ul">
<li><a href="/">home</a></li>
<li><a href="https://git.javalsai.dynv6.net/">gitea</a></li>
<li><a href="/tools">tools</a></li>
<li><a href="/notes">notes</a></li>
<button class="theme-toggle-button" onclick="light_mode()"><img class="theme-toggle-image" height="12px" margin="0px" /></button>
</ul>
</nav>
<script>
function light_mode() {
var element = document.body;
element.classList.toggle("light-mode");
}
</script>
</header>