Update modeTheme.js

This commit is contained in:
Code Hangen 2022-12-14 22:43:00 -03:00 committed by GitHub
parent 7688e1b7b9
commit 710a0b0c78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,14 @@
function modeTheme() { // license: https://www.w3schools.com/howto/howto_js_toggle_dark_mode.asp
function darkTheme() {
var element = document.body; var element = document.body;
element.classList.toggle("dark-mode"); element.classList.toggle("dark-mode");
document.getElementById("btn1").style.color = "white"; var button = document.querySelector("button")
document.getElementById("btn2").style.color = "white"; button.classList.add("dark-modeBtn")
document.getElementById("btn3").style.color = "white"; }
document.getElementById("btn4").style.color = "white";
document.getElementById("btn5").style.color = "white"; function lightTheme() {
document.getElementById("btn6").style.color = "white"; var body = document.querySelector("body")
body.classList.remove("dark-mode")
var button = document.querySelector("button")
button.classList.remove("dark-modeBtn")
} }