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

Added dark mode to the website #25

Merged
merged 6 commits into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions assets/about/about.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,21 @@ body {
.feature-grid {
grid-template-columns: 1fr;
}
}
/* Dark mode styles */
body.dark-mode .about-section {
background-color: #1e1e1e;
color: #f4f4f4;
}

body.dark-mode .about-image {
filter: brightness(80%);
}

body.dark-mode .feature-item {
background-color: #282828;
color: #f4f4f4;
}
body.dark-mode .about-content {
background-color:rgba(40, 44, 52, 1);
}
5 changes: 5 additions & 0 deletions assets/about/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<button class="theme-btn" data-color="purple" aria-label="Purple theme"></button>
</div>
</div>
<div class="dark-mode-switcher">
<button id="dark-mode-toggle" aria-label="Toggle dark mode">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>
Expand Down
21 changes: 21 additions & 0 deletions assets/contact/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,25 @@ textarea {

.submit-button:focus:not(:active) {
transition: box-shadow 0.3s ease-in-out;
}
/* Dark mode styles */
body.dark-mode .contact-section {
background-color: #1e1e1e;
color: #f4f4f4;
}

body.dark-mode .contact-form {
background-color: #282828;
color: #f4f4f4;
}

body.dark-mode .contact-form input,
body.dark-mode .contact-form textarea {
background-color: #333;
color: #f4f4f4;
}

body.dark-mode .submit-button {
background-color: #444;
color: #f4f4f4;
}
5 changes: 5 additions & 0 deletions assets/contact/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<button class="theme-btn" data-color="purple" aria-label="Purple theme"></button>
</div>
</div>
<div class="dark-mode-switcher">
<button id="dark-mode-toggle" aria-label="Toggle dark mode">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>
Expand Down
18 changes: 18 additions & 0 deletions assets/pastevents/pastevents.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,21 @@ body {
background-color: var(--secondary-color);
transform: translateY(-2px);
}
/* Dark mode styles */
body.dark-mode .past-events-section {
background-color: #1e1e1e;
color: #f4f4f4;
}

body.dark-mode .event-grid {
background-color: #282828;
color: #f4f4f4;
}

body.dark-mode .event-card {
background-color: #333;
color: #f4f4f4;
}
body.dark-mode .past-event-card{
background-color: #333;
}
5 changes: 5 additions & 0 deletions assets/pastevents/pastevents.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<button class="theme-btn" data-color="purple" aria-label="Purple theme"></button>
</div>
</div>
<div class="dark-mode-switcher">
<button id="dark-mode-toggle" aria-label="Toggle dark mode">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>
Expand Down
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<button class="theme-btn" data-color="purple" aria-label="Purple theme"></button>
</div>
</div>
<div class="dark-mode-switcher">
<button id="dark-mode-toggle" aria-label="Toggle dark mode">
<i class="fas fa-moon"></i>
</button>
</div>
</div>
</div>
</nav>
Expand Down
3 changes: 3 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,7 @@ document.addEventListener('DOMContentLoaded', () => {
behavior: 'smooth'
});
});
});
document.getElementById('dark-mode-toggle').addEventListener('click', () => {
document.body.classList.toggle('dark-mode');
});
42 changes: 42 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -456,4 +456,46 @@ body {
.explore-button {
padding: 0.8rem 2rem;
}
}
/* Dark mode styles */
body.dark-mode {
--background-color: #181818;
--text-color: #f4f4f4;
--light-text-color: #bbbbbb;
}

body.dark-mode .navbar {
background-color: rgba(24, 24, 24, 0.9);
}

body.dark-mode .footer {
background-color: #181818;
}

/* Dark mode toggle button styles */
#dark-mode-toggle {
background-color: var(--primary-color);
border: none;
cursor: pointer;
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
margin-left: 1rem;
}

#dark-mode-toggle:hover {
background-color: var(--secondary-color);
}

#dark-mode-toggle i {
color: #fff;
font-size: 20px;
}
.dark-mode .events{
background-color: #2a2a2a;
}
Loading