-
Notifications
You must be signed in to change notification settings - Fork 31
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 mood #108
Open
maulikvrl2010
wants to merge
6
commits into
hyphanet:main
Choose a base branch
from
maulikvrl2010:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dark mood #108
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3aa182a
Update footer.html
maulikvrl2010 9e9fc04
Update index.html
maulikvrl2010 9244519
Dark css
maulikvrl2010 c21ca66
Create dark-themeauto.js
maulikvrl2010 22282db
Add files via upload
maulikvrl2010 4fa0ef9
Update index.html
maulikvrl2010 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,30 @@ | ||
const darkModeToggle = document.getElementById('darkModeToggle'); | ||
const body = document.body; | ||
|
||
|
||
darkModeToggle.addEventListener('change', function() { | ||
body.classList.toggle('dark-mode'); | ||
localStorage.setItem('darkModeEnabled', body.classList.contains('dark-mode')); | ||
|
||
}); | ||
|
||
// Check if dark mode was enabled previously | ||
if (localStorage.getItem('darkModeEnabled') === 'true') { | ||
body.classList.add('dark-mode'); | ||
darkModeToggle.checked = true; | ||
|
||
} | ||
|
||
// Check if user prefers dark or light color scheme and apply styles accordingly | ||
const prefersDarkScheme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; | ||
const prefersLightScheme = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches; | ||
|
||
if (prefersDarkScheme) { | ||
body.classList.add('dark-mode'); | ||
darkModeToggle.checked = true; | ||
|
||
} else if (prefersLightScheme) { | ||
body.classList.remove('dark-mode'); | ||
darkModeToggle.checked = false; | ||
|
||
} |
This file contains 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,248 @@ | ||
body { | ||
background-color: var(--background-color); | ||
color: var(--text-color); | ||
} | ||
|
||
/* | ||
section { | ||
background-color: var(--section-color); | ||
padding: 20px; | ||
} | ||
*/ | ||
footer { | ||
background-color: var(--footer-color); | ||
padding: 20px; | ||
} | ||
|
||
.dark-mode { | ||
--background-color: #303030; | ||
--text-color: #ffffff; | ||
--header-color: #1c1c1c; | ||
--section-color: #242424; | ||
--footer-color: #1c1c1c; | ||
} | ||
|
||
.light-mode { | ||
--background-color: #ffffff; | ||
--text-color: #000000; | ||
--header-color: #f0f0f0; | ||
--section-color: #e0e0e0; | ||
--footer-color: #f0f0f0; | ||
} | ||
|
||
#theme-toggle { | ||
padding: 8px 16px; | ||
background-color: #ffffff; | ||
color: #000000; | ||
border: none; | ||
cursor: pointer; | ||
} | ||
|
||
#theme-toggle.dark { | ||
background-color: #000000; | ||
color: #ffffff; | ||
} | ||
#theme-toggle.body>div { | ||
background: #000000; | ||
color: #ffffff; | ||
} | ||
|
||
.switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 60px; | ||
height: 34px; | ||
margin-left: 0.75em; | ||
} | ||
|
||
.switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
.slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
transition: 0.4s; | ||
border-radius: 34px; | ||
} | ||
|
||
.slider:before { | ||
position: absolute; | ||
content: ""; | ||
height: 26px; | ||
width: 26px; | ||
left: 4px; | ||
bottom: 4px; | ||
background-color: #fff; | ||
transition: 0.4s; | ||
border-radius: 50%; | ||
} | ||
|
||
input:checked + .slider { | ||
background-color: #fff; | ||
} | ||
|
||
input:checked + .slider:before { | ||
transform: translateX(26px); | ||
background-color: #000; | ||
} | ||
|
||
.round { | ||
border-radius: 34px; | ||
} | ||
body.dark-mode > div:first-child { | ||
color: #f0f0f0; | ||
background: linear-gradient(to right,#000 800px,rgba(27,62,125,0) 1024px),url(https://www.hyphanet.org/theme/images/graph-white.png),linear-gradient(to bottom,#000 0,#000 100%); | ||
background-repeat: no-repeat; | ||
background-position: top right; | ||
} | ||
body.dark-mode nav { | ||
border-radius: .25em; | ||
background-color: #1B3E7D; | ||
background-color: #8595B3; | ||
background: linear-gradient(to right,#121212 12em,rgba(1, 1, 1, 0) 100%),url('images/dark-graph-white.png'),#101010F7; | ||
background-position-x: 0%, 0%, 0%; | ||
background-position-y: 0%, 0%, 0%; | ||
background-repeat: repeat, repeat, repeat; | ||
background-repeat: no-repeat; | ||
background-position: top right; | ||
display: block; | ||
} | ||
body.dark-mode .download-button{ | ||
background: #000; | ||
} | ||
body.dark-mode #features p{ | ||
background-color: #303030; | ||
color: #ffffff; | ||
} | ||
body.dark-mode #news ol li p{ | ||
color: #ffffff; | ||
} | ||
body.dark-mode #testimonials cite::after { | ||
content: url('images/dark-endorsement-blue.png'); | ||
} | ||
body.dark-mode h4{ | ||
background-color: #000; | ||
} | ||
|
||
body.dark-mode > body>div:nth-of-type(2) { | ||
background: url(../images/graph-grey.png); | ||
background-repeat: no-repeat; | ||
background-position: left -5em; | ||
padding-top: 3em; | ||
padding-top: 1px; | ||
padding-bottom: 1em; | ||
} | ||
|
||
body.dark-mode #news{ | ||
background-color: #303030; | ||
} | ||
|
||
body.dark-mode section h2{ | ||
color: #cccccc; | ||
} | ||
body.dark-mode #features h3{ | ||
color: #cccccc; | ||
} | ||
|
||
|
||
body.dark-mode main h1, h2, h3, h4, h5, h6{ | ||
color: #fff; | ||
} | ||
|
||
body.dark-mode #features li:nth-of-type(4) h3:before{ | ||
display: block; | ||
content: url('images/dark-platform-blue.png'); | ||
} | ||
|
||
body.dark-mode #features li:nth-of-type(3) h3::before { | ||
display: block; | ||
content: url('images/dark-forums-blue.png'); | ||
} | ||
|
||
body.dark-mode #features li:nth-of-type(2) h3::before { | ||
display: block; | ||
content: url('images/dark-browse-blue.png'); | ||
} | ||
|
||
body.dark-mode #features li:nth-of-type(1) h3::before { | ||
display: block; | ||
content: url('images/dark-identity-blue.png'); | ||
} | ||
|
||
|
||
.toggle-container { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.toggle-label { | ||
margin-left: 10px; | ||
display: inline-block; | ||
height: 29px; | ||
line-height: 29px; | ||
vertical-align: middle; | ||
color: #fafbfc; | ||
margin-left: 0.75em; | ||
font-size: 104%; | ||
font-weight: 700; | ||
} | ||
|
||
.toggle-switch { | ||
position: relative; | ||
display: inline-block; | ||
width: 60px; | ||
height: 34px; | ||
} | ||
|
||
.toggle-switch input { | ||
opacity: 0; | ||
width: 0; | ||
height: 0; | ||
} | ||
|
||
.toggle-slider { | ||
position: absolute; | ||
cursor: pointer; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: #ccc; | ||
transition: .4s; | ||
border-radius: 34px; | ||
} | ||
|
||
.toggle-slider:before { | ||
position: absolute; | ||
content: "\f186"; | ||
font-family: "Font Awesome 5 Free"; | ||
font-weight: 900; | ||
font-size: 12px; | ||
line-height: 34px; | ||
width: 34px; | ||
height: 34px; | ||
left: 0; | ||
bottom: 0; | ||
background-color: white; | ||
transition: .4s; | ||
border-radius: 50%; | ||
text-align: center; | ||
color: #000; | ||
} | ||
|
||
input:checked + .toggle-slider { | ||
background-color: #2196F3; | ||
} | ||
|
||
input:checked + .toggle-slider:before { | ||
content: "\f185"; | ||
transform: translateX(26px); | ||
} |
This file contains 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was changed in the graph?