nelle-observer/astro/public/scripts/sga.js
2024-08-24 03:26:05 -06:00

26 lines
721 B
JavaScript

// IF YOU EDIT ANYTHING IN HERE DONT FORGET TO EDIT THE SCRIPT IN LAYOUT.ASTRO BECAUSE FUCK ME
function onload() {
if (sessionStorage.getItem("sgaEnabled")) {
enableSGA()
}
}
function enableSGA() {
document.getElementById("body").style.fontFamily = "standardGalactic, system-ui";
sessionStorage.setItem("sgaEnabled", 1);
console.debug(sessionStorage.getItem("sgaEnabled"));
}
function disableSGA() {
document.getElementById("body").style.fontFamily = "terminess-nf, system-ui";
sessionStorage.removeItem("sgaEnabled");
console.debug(sessionStorage.getItem("sgaEnabled"));
}
function toggleTheme() {
if (!sessionStorage.getItem("sgaEnabled")) {
enableSGA();
} else {
disableSGA();
}
}