nelle-observer/astro/public/scripts/sga.js
2024-09-03 16:06:59 -06:00

27 lines
637 B
JavaScript

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 =
"departure-mono, system-ui";
sessionStorage.removeItem("sgaEnabled");
console.debug(sessionStorage.getItem("sgaEnabled"));
}
function toggleTheme() {
if (!sessionStorage.getItem("sgaEnabled")) {
enableSGA();
} else {
disableSGA();
}
}