Quick & Hacky Theme Toggler

Just to add the base functionality, will improve upon this later.
This commit is contained in:
Corban-Lee Jones 2024-01-22 11:15:57 +00:00
parent 4761db6541
commit 863f5cf6ec
3 changed files with 17 additions and 0 deletions

10
apps/static/js/base.js Normal file
View File

@ -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");
}
});

View File

@ -17,6 +17,11 @@
</li>
</ul>
<ul class="nav-right">
<li>
<a href="" id="themeToggle" data-bs-toggle="dropdown">
<i class="ti-shine"></i>
</a>
</li>
<li class="notifications dropdown">
<!-- <span class="counter bgc-red">3</span> -->
<a href="" class="dropdown-toggle no-after" data-bs-toggle="dropdown">

View File

@ -11,3 +11,5 @@
<script src="{% static '/js/perfectscrollbar.js' %}"></script>
<script src="{% static '/js/index.js' %}"></script>
<script src="{% static '/js/base.js' %}"></script>