diff --git a/public/js/script.js b/public/js/script.js index 9d4cd52..a348690 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1,26 +1,32 @@ document.addEventListener('DOMContentLoaded', function(){ const darkModeToggle = document.getElementById("dark-mode-toggle"); + const icon=document.getElementById('dark-icon'); const body = document.body; - + const savedDarkMode = localStorage.getItem('darkMode'); if (savedDarkMode == 'enabled') { + body.classList.add('dark-mode'); + icon.classList.add('fa-sun') } else { body.classList.remove('dark-mode'); - if (darkModeToggle) darkModeToggle.textContent ='Dark Mode'; + icon.classList.add('fa-moon') } if (darkModeToggle) { + darkModeToggle.addEventListener("click", function() { body.classList.toggle("dark-mode"); - + if (body.classList.contains('dark-mode')){ localStorage.setItem('darkMode','enabled'); - darkModeToggle.textContent ="Light Mode"; + icon.classList.remove('fa-moon'); + icon.classList.add('fa-sun'); } else { localStorage.setItem('darkMode','disabled'); - darkModeToggle.textContent ="Dark Mode"; + icon.classList.remove('fa-sun'); + icon.classList.add('fa-moon'); } }); } diff --git a/views/contact.ejs b/views/contact.ejs index ddebe75..fca333c 100644 --- a/views/contact.ejs +++ b/views/contact.ejs @@ -1,5 +1,5 @@ -
-
+
+

Contact Us

If you have any questions or feedback, feel free to reach out!

@@ -25,5 +25,5 @@
- +
\ No newline at end of file diff --git a/views/layouts/main.ejs b/views/layouts/main.ejs index 26e783d..8cdf55f 100644 --- a/views/layouts/main.ejs +++ b/views/layouts/main.ejs @@ -16,13 +16,7 @@
<%- include('../partials/header.ejs') %> - -
- -
- - <%- include('../partials/header.ejs', { currentRoute: locals.currentRoute }) %> - +
<%- body %>
diff --git a/views/partials/header.ejs b/views/partials/header.ejs index 1ca0599..2c50c39 100644 --- a/views/partials/header.ejs +++ b/views/partials/header.ejs @@ -12,9 +12,6 @@
  • Contact
  • -
  • - Login -
  • Post
  • @@ -38,7 +35,12 @@ <% } %> - + + + +