From 4b7262f64b573a97b9833bd560176780d4720db8 Mon Sep 17 00:00:00 2001 From: PrestonT500 Date: Wed, 2 Oct 2024 18:08:18 -0700 Subject: [PATCH] Dark mode fully works (colors are for testing, someone make them good) + deleted old darkmode.js --- css/index.css | 5 +++-- js/darkmode.js | 17 ----------------- js/darkmoderewrite.js | 33 +++++++++++++++++++++++++-------- 3 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 js/darkmode.js diff --git a/css/index.css b/css/index.css index 619b3a9..52b50f2 100644 --- a/css/index.css +++ b/css/index.css @@ -55,11 +55,12 @@ h1 { color: #000000; } -h2, +h2 { + color: #000000; +} p { color: #000000; } - button { background-color: #4caf50; color: white; diff --git a/js/darkmode.js b/js/darkmode.js deleted file mode 100644 index 2333ad1..0000000 --- a/js/darkmode.js +++ /dev/null @@ -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"; - } - } -} diff --git a/js/darkmoderewrite.js b/js/darkmoderewrite.js index b802caa..3769e8e 100644 --- a/js/darkmoderewrite.js +++ b/js/darkmoderewrite.js @@ -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'; + }); } }