Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark & Light mode icons added #255

Merged
merged 2 commits into from
Nov 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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