Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ebsite into sunicon
  • Loading branch information
nikki-05 committed Aug 8, 2024
2 parents 4f5be27 + e2a3049 commit b2c3668
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Html-files/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ themeToggleIcon.addEventListener("click", function () {
document.body.classList.toggle("dark-theme");
document.body.classList.toggle(":root")
if (themeToggleIcon.src.includes('moon.png')) {
// If it's moon (dark theme), switch to sun (light theme)
// If it's moon (dark theme), switch to (light theme)
themeToggleIcon.src = 'Images/navbar/sun2.png';
document.body.classList.add('light-theme'); // Add light theme class to body
document.body.classList.add('light-theme'); // Add light theme
document.body.classList.remove('dark-theme'); // Remove dark theme class from body
} else {
}
else {
// If it's sun (light theme), switch to moon (dark theme)
themeToggleIcon.src = 'Images/navbar/moon.png';
document.body.classList.add('dark-theme'); // Add dark theme class to body
Expand Down

0 comments on commit b2c3668

Please sign in to comment.