okay i got it fucks sake
This commit is contained in:
parent
5705a15dce
commit
81f9a4b592
1 changed files with 11 additions and 6 deletions
|
@ -1,17 +1,22 @@
|
||||||
function onload() {
|
function onload() {
|
||||||
|
if (localStorage.getItem('sgaEnabled')) {
|
||||||
|
enableSGA()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
disableSGA()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableSGA() {
|
function enableSGA() {
|
||||||
document.getElementById("body").style.fontFamily = "standardGalactic, system-ui";
|
document.getElementById("body").style.fontFamily = "standardGalactic, system-ui";
|
||||||
document.getElementById("body").style.fontWeight = "lighter";
|
document.getElementById("body").style.fontWeight = "lighter";
|
||||||
localStorage.setItem( 'sgaEnabled', true );
|
localStorage.setItem( 'sgaEnabled', 1);
|
||||||
console.debug(localStorage.getItem('sgaEnabled'))
|
console.debug(localStorage.getItem('sgaEnabled'))
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableSGA() {
|
function disableSGA() {
|
||||||
document.getElementById("body").style.fontFamily = " terminess-nf, system-ui";
|
document.getElementById("body").style.fontFamily = "terminess-nf, system-ui";
|
||||||
localStorage.setItem( 'sgaEnabled', false );
|
localStorage.removeItem( 'sgaEnabled');
|
||||||
console.debug(localStorage.getItem('sgaEnabled'))
|
console.debug(localStorage.getItem('sgaEnabled'))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,10 +24,10 @@ function toggleTheme() {
|
||||||
// Obtains an array of all <link>
|
// Obtains an array of all <link>
|
||||||
// elements.
|
// elements.
|
||||||
// Select your element using indexing.
|
// Select your element using indexing.
|
||||||
if (document.getElementById("body").style.fontFamily !== "standardGalactic, system-ui") {
|
if (!localStorage.getItem('sgaEnabled')) {
|
||||||
enableSGA()
|
enableSGA()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
disableSGA()
|
disableSGA()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue