Skip to content

Commit

Permalink
Changed the dark mode icon
Browse files Browse the repository at this point in the history
  • Loading branch information
prakhar-1005 committed Nov 25, 2022
1 parent 247c30b commit 42cbbeb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@

<!--dark mode button is now outside the option class-->
<button onclick="darkMode()" class="toggleButton">
<i class='fas fa-sun'></i>
<i class="fa-solid fa-moon fa-2x" id="dark-mode-enable"></i>
</button>
</nav>

Expand Down
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ function darkMode() {
element.style.borderRight = "2px solid white";
}
}
const toggleButton = document.getElementById("dark-mode-enable");

if(toggleButton.classList.contains("fa-moon")){
toggleButton.classList.remove("fa-moon");
toggleButton.classList.add("fa-lightbulb");
}
else{
toggleButton.classList.remove("fa-lightbulb");
toggleButton.classList.add("fa-moon");
}
}
const toggles = document.querySelectorAll(".faq-toggle");

Expand Down

0 comments on commit 42cbbeb

Please sign in to comment.