whatever it works i guess

This commit is contained in:
nelle 2024-08-24 03:07:18 -06:00
parent 5d4183c0a0
commit 41b2e51daa
2 changed files with 27 additions and 25 deletions

View file

@ -1,30 +1,20 @@
function onload() {
if (sessionStorage.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";
sessionStorage.setItem( 'sgaEnabled', 1); sessionStorage.setItem("sgaEnabled", 1);
console.debug(sessionStorage.getItem('sgaEnabled')) console.debug(sessionStorage.getItem("sgaEnabled"));
} }
function disableSGA() { function disableSGA() {
document.getElementById("body").style.fontFamily = "terminess-nf, system-ui"; document.getElementById("body").style.fontFamily = "terminess-nf, system-ui";
sessionStorage.removeItem( 'sgaEnabled'); sessionStorage.removeItem("sgaEnabled");
console.debug(sessionStorage.getItem('sgaEnabled')) console.debug(sessionStorage.getItem("sgaEnabled"));
} }
function toggleTheme() { function toggleTheme() {
if (!sessionStorage.getItem('sgaEnabled')) { if (!sessionStorage.getItem("sgaEnabled")) {
enableSGA() enableSGA();
} } else {
else { disableSGA();
disableSGA()
} }
} }

View file

@ -5,7 +5,7 @@ import Footer from "../components/Footer.astro";
import NormalScripts from "../components/scripts/normal-scripts.astro"; import NormalScripts from "../components/scripts/normal-scripts.astro";
interface Props { interface Props {
title: string; title: string;
} }
const { title } = Astro.props; const { title } = Astro.props;
@ -14,9 +14,9 @@ const { title } = Astro.props;
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<Head title={title}/> <Head title={title} />
</head> </head>
<body onload="onload()" id="body"> <body onload="test" id="body">
<Header /> <Header />
<section class="content center"> <section class="content center">
<h1 class="title">{title}</h1> <h1 class="title">{title}</h1>
@ -24,10 +24,22 @@ const { title } = Astro.props;
<slot /> <slot />
<Footer /> <Footer />
<NormalScripts /> <NormalScripts />
<script is:inline src="/scripts/fuckchrome.js"></script> <script
is:inline
src="/scripts/fuckchrome.js"
></script>
<script type="text/javascript">
if (sessionStorage.getItem("sgaEnabled")) {
document.getElementById("body").style.fontFamily =
"standardGalactic, system-ui";
document.getElementById("body").style.fontWeight = "lighter";
sessionStorage.setItem("sgaEnabled", 1);
console.debug(sessionStorage.getItem("sgaEnabled"));
}
</script>
<audio <audio
id="clickSound" id="clickSound"
src="/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3"> src="/assets/sounds/ui/zapsplat_multimedia_button_click_004_68776.mp3">
</audio> </audio>
</body> </body>
</html> </html>