nelle-observer/astro/public/scripts/sga.js

30 lines
720 B
JavaScript

function onload() {
if (sessionStorage.getItem('sgaEnabled')) {
enableSGA()
}
else {
disableSGA()
}
}
function enableSGA() {
document.getElementById("body").style.fontFamily = "standardGalactic, system-ui";
document.getElementById("body").style.fontWeight = "lighter";
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()
}
}