Quick & Hacky Theme Toggler
Just to add the base functionality, will improve upon this later.
This commit is contained in:
parent
4761db6541
commit
863f5cf6ec
10
apps/static/js/base.js
Normal file
10
apps/static/js/base.js
Normal 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");
|
||||||
|
}
|
||||||
|
});
|
@ -17,6 +17,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav-right">
|
<ul class="nav-right">
|
||||||
|
<li>
|
||||||
|
<a href="" id="themeToggle" data-bs-toggle="dropdown">
|
||||||
|
<i class="ti-shine"></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="notifications dropdown">
|
<li class="notifications dropdown">
|
||||||
<!-- <span class="counter bgc-red">3</span> -->
|
<!-- <span class="counter bgc-red">3</span> -->
|
||||||
<a href="" class="dropdown-toggle no-after" data-bs-toggle="dropdown">
|
<a href="" class="dropdown-toggle no-after" data-bs-toggle="dropdown">
|
||||||
|
@ -11,3 +11,5 @@
|
|||||||
<script src="{% static '/js/perfectscrollbar.js' %}"></script>
|
<script src="{% static '/js/perfectscrollbar.js' %}"></script>
|
||||||
|
|
||||||
<script src="{% static '/js/index.js' %}"></script>
|
<script src="{% static '/js/index.js' %}"></script>
|
||||||
|
|
||||||
|
<script src="{% static '/js/base.js' %}"></script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user