From 869adde0c04ba6e54af3363a40f5ba662a584ee6 Mon Sep 17 00:00:00 2001 From: jeevika17 Date: Thu, 17 Oct 2024 22:18:06 +0530 Subject: [PATCH] the letters are more visible in darkmode --- index.js | 21 +++++++++++++++++++++ style.css | 13 +++++++++++++ 2 files changed, 34 insertions(+) diff --git a/index.js b/index.js index f548449..4e10a00 100644 --- a/index.js +++ b/index.js @@ -20,3 +20,24 @@ window.addEventListener('scroll', function(){ }) +document.addEventListener('DOMContentLoaded',() => { + const darkToggle = document.getElementById('dark-change'); + + if(localStorage.getItem('darkMode') === 'enabled'){ + document.body.classList.add('dark-mode'); + darkToggle.classList.add('active'); + } + + darkToggle.addEventListener('click' , ()=> + { + document.body.classList.toggle('dark-mode'); + darkToggle.classList.toggle('active'); + + if (document.body.classList.contains('dark-mode')){ + localStorage.setItem('darkMode','enabled'); + } + else{ + localStorage.setItem('darkMode','disabled'); + } + }); +}); \ No newline at end of file diff --git a/style.css b/style.css index 68ca411..d67537e 100644 --- a/style.css +++ b/style.css @@ -439,6 +439,19 @@ footer h5 { } +body.night .mb-2{ + color: #000; + font-size: small; + text-align: left; +} + +body.night .mb-0{ + color: #000; + font-size: small; + text-align: left; +} + + .bt1 { background: url("img/feature-1.jpg") center/cover; }