-
Notifications
You must be signed in to change notification settings - Fork 52
Feature/Adding DarkMode option to project #301
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
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
44d5e01
feat: adding darkmode feature
e5a167a
Merge branch 'develop' into darkmode
7bd6047
feat: adding darkmode feature
c69dc29
Merge branch 'develop' into darkmode
d31d109
feat: adding darkmode feature
1e2af3e
fix: adding semicolons to js
0b5e276
Merge branch 'develop' into darkmode
0dd83f8
fix: mr comments
ec30dab
fix: minor fix for credit page
1056de9
Merge branch 'develop' into darkmode
f80fb48
Merge branch 'develop' into darkmode
26dd815
fix: solve mr conflicts
714d1be
fix: fixed mr comments
e4a7521
Merge branch 'develop' into darkmode
9f28f80
Merge branch 'develop' into darkmode
galzunited 2bd7bb3
fix: minor fixes for darkmode
f35c749
Merge remote-tracking branch 'origin/darkmode' into darkmode
d9446da
Merge branch 'develop' into darkmode
ba2fedb
fix: minor spelling fix for dependency
09c5204
Merge branch 'develop' into darkmode
galzunited b950219
fix: fix for dependency
78186e4
Merge branch 'develop' into darkmode
294152b
fix: reverted audio.py
9516eb1
fix: reverted audio.py
8657a48
fix: fixed mr comments
b1efd67
fix: fixed mr comments
e4aaa42
fix: fixed mr comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
body { | ||
margin-left: 6.25em; | ||
margin-right: 6.25em; | ||
background-color: var(--backgroundcol); | ||
} | ||
|
||
div.gallery { | ||
|
This file contains hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,29 @@ | ||
const ROOT = document.documentElement; | ||
|
||
window.addEventListener("DOMContentLoaded", (event) => { | ||
const button = document.getElementById("darkmode"); | ||
let isDarkMode = localStorage.getItem("isDarkMode") == "true"; | ||
setThemeMode(isDarkMode, button, ROOT); | ||
button.addEventListener("click", (event) => { | ||
isDarkMode = !isDarkMode; | ||
localStorage.setItem("isDarkMode", isDarkMode); | ||
setThemeMode(isDarkMode, button, ROOT); | ||
}); | ||
}); | ||
|
||
function changeIcon(mode) { | ||
const modeButton = document.getElementById("darkmode"); | ||
modeButton.name = mode; | ||
} | ||
|
||
function setThemeMode(isDarkMode, button, root) { | ||
if (isDarkMode) { | ||
root.dataset['colorMode'] = "dark"; | ||
button.name = "moon"; | ||
changeIcon("moon"); | ||
} else { | ||
root.dataset['colorMode'] = "regular"; | ||
button.name = "moon-outline"; | ||
changeIcon("moon-outline"); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.