From 863f5cf6ec310a9b4067162d2e8ee8b7f0429a3c Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Mon, 22 Jan 2024 11:15:57 +0000 Subject: [PATCH] Quick & Hacky Theme Toggler Just to add the base functionality, will improve upon this later. --- apps/static/js/base.js | 10 ++++++++++ apps/templates/includes/navigation.html | 5 +++++ apps/templates/includes/scripts.html | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 apps/static/js/base.js diff --git a/apps/static/js/base.js b/apps/static/js/base.js new file mode 100644 index 0000000..94ef231 --- /dev/null +++ b/apps/static/js/base.js @@ -0,0 +1,10 @@ +$("#themeToggle").on("click", function() { + const currentTheme = $("body").attr("data-bs-theme"); + + if (currentTheme == "light") { + $("body").attr("data-bs-theme", "dark"); + } + else { + $("body").attr("data-bs-theme", "light"); + } +}); \ No newline at end of file diff --git a/apps/templates/includes/navigation.html b/apps/templates/includes/navigation.html index 7e82afa..4a4733f 100644 --- a/apps/templates/includes/navigation.html +++ b/apps/templates/includes/navigation.html @@ -17,6 +17,11 @@