re-initialize and make some changes. repository got to around 2 gigabytes and needed to be more efficient

This commit is contained in:
soap
2023-09-29 12:56:26 -05:00
commit 234e4592fa
1441 changed files with 476627 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
function switchButton() {
var currentTheme = document.documentElement.getAttribute("data-theme");
if (currentTheme === "dark") {
$('#dark-toggle').html("<span class='icon-fa5-sun'></span>");
} else {
$('#dark-toggle').html("<span class='icon-fa5-moon'></span>");
}
}
$( document ).ready(function() {
var darkToggle = document.getElementById("dark-toggle");
darkToggle.onclick = function() {
event.preventDefault();
var currentTheme = document.documentElement.getAttribute("data-theme");
var switchToTheme = currentTheme === "dark" ? "light" : "dark"
document.documentElement.setAttribute("data-theme", switchToTheme);
if (switchToTheme === "dark") {
localStorage.darkmode = "1";
console.log("Night theme enabled, localStorage.darkmode = "+localStorage.darkmode);
} else {
localStorage.darkmode = "0";
console.log("Day theme enabled, localStorage.darkmode = "+localStorage.darkmode);
}
switchButton();
}
switchButton();
});