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

34 lines
800 B
JavaScript
Raw Normal View History

2024-08-03 01:35:08 -06:00
function onload() {
2024-08-24 02:00:50 -06:00
if (localStorage.getItem('sgaEnabled')) {
enableSGA()
}
else {
disableSGA()
}
2024-08-24 00:58:47 -06:00
}
function enableSGA() {
document.getElementById("body").style.fontFamily = "standardGalactic, system-ui";
document.getElementById("body").style.fontWeight = "lighter";
2024-08-24 02:00:50 -06:00
localStorage.setItem( 'sgaEnabled', 1);
2024-08-24 00:58:47 -06:00
console.debug(localStorage.getItem('sgaEnabled'))
}
function disableSGA() {
2024-08-24 02:00:50 -06:00
document.getElementById("body").style.fontFamily = "terminess-nf, system-ui";
localStorage.removeItem( 'sgaEnabled');
2024-08-24 00:58:47 -06:00
console.debug(localStorage.getItem('sgaEnabled'))
2024-08-03 01:35:08 -06:00
}
function toggleTheme() {
// Obtains an array of all <link>
// elements.
// Select your element using indexing.
2024-08-24 02:00:50 -06:00
if (!localStorage.getItem('sgaEnabled')) {
2024-08-24 01:05:18 -06:00
enableSGA()
2024-08-24 00:58:47 -06:00
}
2024-08-24 02:00:50 -06:00
else {
2024-08-24 01:05:18 -06:00
disableSGA()
2024-08-03 01:35:08 -06:00
}
}