Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions js/darkMode.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
function darkMode() { if (document.body.style.backgroundColor == "black") {
/*
Nuevamente, te recomiendo revisar mejor cómo llamas las funciones
porque de resto está perfecto.
*/

function changeMainColor() {
if (document.body.style.backgroundColor == "black") {
document.body.style.backgroundColor = "white";
document.body.style.color = "black";
if (location.pathname === "/en.html") {
Expand All @@ -21,7 +27,7 @@ function darkMode() { if (document.body.style.backgroundColor == "black") {
function listeners() {
this.document
.getElementById("cambioTema")
.addEventListener("click", darkMode);
.addEventListener("click", changeMainColor);
}

window.addEventListener("load", listeners, false);