Skip to content

Commit

Permalink
Merge pull request #255 from prakhar-1005/darkModeIcon
Browse files Browse the repository at this point in the history
Dark & Light mode icons added
  • Loading branch information
regdocs authored Nov 26, 2022
2 parents 247c30b + 931a665 commit f8496d1
Show file tree
Hide file tree
Showing 4 changed files with 16 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
}
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ Daniele Avolio <[email protected]>
Adhetya Narayan J.M <[email protected]>
Ranjana Reghunath <[email protected]>
Rudraksh Karpe <[email protected]>
Prakhar Pandey <[email protected]>
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
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ 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 f8496d1

Please sign in to comment.