diff --git a/views/includes/navbar.ejs b/views/includes/navbar.ejs index 69a9a3e9..c7e76a71 100644 --- a/views/includes/navbar.ejs +++ b/views/includes/navbar.ejs @@ -202,27 +202,33 @@ function toggleDarkMode() { - const body = document.body; - const navbar = document.querySelector(".navbar"); - const aboutSection = document.querySelector(".about"); - const darkModeToggle = document.querySelector(".dark-mode-toggle"); - - const darkModeIcon = document.getElementsByClassName("dark-mode-icon"); - var darkModeIconCollection = Array.from(darkModeIcon); - - body.classList.toggle("dark-mode"); - navbar.classList.toggle("dark-mode"); - aboutSection.classList.toggle("dark-mode"); - // darkModeToggle.classList.toggle("dark"); - - darkModeIconCollection.map((darkIcon) => { - if (darkIcon.innerHTML === '') { - darkIcon.innerHTML = ''; - } else { - darkIcon.innerHTML = ''; - } - }); + const body = document.body; + const navbar = document.querySelector(".navbar"); + const sections = document.querySelectorAll("main ,section, .about"); + const darkModeIcon = document.querySelectorAll(".dark-mode-icon i"); + + body.classList.toggle("dark-mode"); + navbar.classList.toggle("dark-mode"); + sections.forEach(section => { + section.classList.toggle("dark-mode"); + }); + + darkModeIcon.forEach(icon => { + icon.classList.toggle("fa-sun"); + icon.classList.toggle("fa-moon"); + }); + + // Store dark mode preference in local storage + localStorage.setItem('darkMode', body.classList.contains('dark-mode')); + } + + // On page load, apply the theme based on local storage + document.addEventListener("DOMContentLoaded", () => { + const isDarkMode = JSON.parse(localStorage.getItem('darkMode')); + if (isDarkMode) { + toggleDarkMode(); // Apply dark mode if it was enabled } + }); diff --git a/views/team.ejs b/views/team.ejs index 3f75cc31..bfb7b88a 100644 --- a/views/team.ejs +++ b/views/team.ejs @@ -72,6 +72,8 @@ justify-content: center; align-items: center; /* padding: 35px 0; */ + + } .widget-container { @@ -125,7 +127,7 @@ transform: none; } -.box-content-wrapper { +.box-content-wrapper { display: flex; width: 100%; height: 100%; @@ -136,6 +138,10 @@ transform: translateZ(90px); border-radius: 50%; + .dark-mode { + background-color: #121212; + color: #ffffff; + } } @@ -163,6 +169,10 @@ -webkit-text-fill-color: transparent; } +.dark-mode .heading-contributors { + -webkit-text-fill-color: #fff; /* Make text white in dark mode */ +} + .heading-contributors:after { content: "Meet our awesome contributors 💙"; position: absolute; @@ -190,7 +200,7 @@ <%- include('includes/navbar.ejs') %>
-
+
Meet our awesome contributors 💙
@@ -280,6 +290,7 @@ .catch((error) => { console.error("Error fetching contributors:", error); }); + + + \ No newline at end of file