Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* corrections were made * added dark-mode * back-to-top-button added * back-to-top button edited * back-to-top button edited * last edit * last edit * arrangements were made * dark-mode-button-updated * dark-mode-option-added
- Loading branch information
1 parent
45e5837
commit 3d9aef2
Showing
6 changed files
with
170 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const darkModeControl = () => { | ||
const darkCheck = document.getElementById('night-light-checkbox'); | ||
|
||
darkCheck.addEventListener('click', () => { | ||
if (darkCheck.checked) { | ||
document.body.classList.add('dark'); | ||
localStorage.setItem('animate-css', 'dark'); | ||
} else { | ||
document.body.classList.remove('dark'); | ||
localStorage.removeItem('animate-css'); | ||
} | ||
}) | ||
|
||
if (localStorage.getItem('animate-css')) { | ||
document.body.className = 'dark'; | ||
darkCheck.checked = true; | ||
} | ||
} | ||
|
||
export default darkModeControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters