Dark mode fully works (colors are for testing, someone make them good) + deleted old darkmode.js

This commit is contained in:
PrestonT500 2024-10-02 18:08:18 -07:00
parent 3238807251
commit 4b7262f64b
3 changed files with 28 additions and 27 deletions

View File

@ -55,11 +55,12 @@ h1 {
color: #000000;
}
h2,
h2 {
color: #000000;
}
p {
color: #000000;
}
button {
background-color: #4caf50;
color: white;

View File

@ -1,17 +0,0 @@
var dCheck = document.getElementById("dMode");
alert("darmode.js working");
dCheck.onclick = function dClick(){
console.log("heck yeah");
var inputs = document.getElementsByTagName('input');
var body = document.body;
body.style.color="f1f1f1";
body.style.backgroundColor="3c3c3c";
for(var i=0; i<inputs.length i++){
if(inputs[i].getAttribute('type')=='button'){
inputs.style.backgroundColor="#13f4f3";
}
}
}

View File

@ -6,8 +6,10 @@ $(document).ready(function() {
body.style.backgroundColor = '#141414';
body.style.color = '#f1f1f1';
const p = document.querySelector('p');
p.style.color = '#f1f1f1';
const paragraphs = document.querySelectorAll('p');
paragraphs.forEach(function(p) {
p.style.color = '#f1f1f1';
});
const headTwo = document.querySelector('h2');
headTwo.style.color = '#f1f1f1';
@ -18,16 +20,25 @@ $(document).ready(function() {
const foot = document.querySelector('.footer');
foot.style.backgroundColor = '#808080';
const button = document.querySelector('button');
button.style.backgroundColor = '#21ccaa';
const buttons = document.querySelectorAll('button');
buttons.forEach(function(button) {
button.style.backgroundColor = '#01452c';
});
const versionTexts = document.querySelectorAll('.version-text');
versionTexts.forEach(function(vt) {
vt.style.color = '#f1f1f1';
});
} else {
const body = document.querySelector('body');
body.style.backgroundColor = '#f1f1f1';
body.style.color = 'black';
const p = document.querySelector('p');
p.style.color = 'black';
const paragraphs = document.querySelectorAll('p');
paragraphs.forEach(function(p) {
p.style.color = 'black';
});
const headTwo = document.querySelector('h2');
headTwo.style.color = 'black';
@ -38,9 +49,15 @@ $(document).ready(function() {
const foot = document.querySelector('.footer');
foot.style.backgroundColor = '#ddd';
const button = document.querySelector('button');
button.style.backgroundColor = '#4caf50';
const buttons = document.querySelectorAll('button');
buttons.forEach(function(button) {
button.style.backgroundColor = '#4caf50';
});
const versionTexts = document.querySelectorAll('.version-text');
versionTexts.forEach(function(vt) {
vt.style.color = 'black';
});
}
}