yeah, it works without javascript now, fuck it, why not

This commit is contained in:
Luna 2025-11-15 21:41:54 -03:00
parent ce72ec9991
commit 8517c24dc6
4 changed files with 79 additions and 24 deletions

View file

@ -15,7 +15,9 @@ back.innerHTML = `⬑Back`
window.addEventListener("load", () => {
stylesheet = document.styleSheets[0];
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`)
document.documentElement.style.setProperty("--vh", `${window.innerHeight * 0.01}px`)
document.styleSheets[3].disabled = true // this one is for non-js
// randomize loading text
fetch("/assets/loading.txt")
@ -29,13 +31,15 @@ window.addEventListener("load", () => {
document.body.appendChild(skipNode);
// get rid of shit since we have javascript babyyyyyyy
if (matchMedia("(min-width: 430px) or (min-height: 430px").matches) {
if (matchMedia("(min-width: 430px) or (min-height: 430px)").matches) {
for (let node of document.getElementsByClassName("nojs")) {
node.style.display = "none"
}
stylesheet.insertRule(".js { visibility: visible }", stylesheet.cssRules.length)
stylesheet.insertRule(".skip-notice { opacity: 1 }", stylesheet.cssRules.length)
stylesheet.insertRule("d:focus { color: var(--c-bg); background-color: var(--c-fg) }", stylesheet.cssRules.length)
stylesheet.insertRule(`@media screen and (min-width: 420px) and (max-width: 649px) { .ascii-2 { display: block !important } }`, stylesheet.cssRules.length)
stylesheet.insertRule(`@media screen and (min-width: 650px) { .ascii-1 { display: block !important } }`, stylesheet.cssRules.length)
document.querySelectorAll("head style").forEach(style => style.remove());
jsDiv = document.getElementsByClassName("js")[0]