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; }