diff --git a/assets/js/dark-mode.js b/assets/js/dark-mode.js new file mode 100644 index 0000000..41e1899 --- /dev/null +++ b/assets/js/dark-mode.js @@ -0,0 +1,14 @@ + +$(document).ready(function () { + $("#darkMode").click(function () { + if (window.document.body.getAttribute("data-theme") != "dark") { + window.document.body.setAttribute("data-theme", "dark"); + $("#darkMode i").text("brightness_high"); + $("#darkMode p").text("Light Mode"); + } else { + window.document.body.setAttribute("data-theme", "light"); + $("#darkMode i").text("brightness_low"); + $("#darkMode p").text("Dark Mode"); + } + }) +}); diff --git a/partials/navigation.hbs b/partials/navigation.hbs index 916ee6a..1bf0073 100644 --- a/partials/navigation.hbs +++ b/partials/navigation.hbs @@ -6,4 +6,9 @@ {{/foreach}} + +
\ No newline at end of file