it looks better on mobile now but i probably did something else without noticing

This commit is contained in:
Luna 2025-11-15 19:15:01 -03:00
parent c6918a4d72
commit 477403badf
2 changed files with 32 additions and 17 deletions

View file

@ -15,6 +15,7 @@ back.innerHTML = `⬑Back`
window.addEventListener("load", () => {
stylesheet = document.styleSheets[0];
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`)
// randomize loading text
fetch("/assets/loading.txt")
@ -28,13 +29,14 @@ window.addEventListener("load", () => {
document.body.appendChild(skipNode);
// get rid of shit since we have javascript babyyyyyyy
if (matchMedia("(min-width: 430px) and (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)
document.querySelectorAll("head style").forEach(style => style.remove());
jsDiv = document.getElementsByClassName("js")[0]
tui.home()
@ -244,15 +246,16 @@ function indexFocus() {
}
document.addEventListener("mouseover", (e) => {
if (e.target.tagName.toLowerCase() === "a" || e.target.tagName.toLowerCase() === "d") {
e.target.focus()
if (side == 0 && focusListSecond.includes(document.activeElement)) {
side = 1
} else if (side == 1 && focusListMain.includes(document.activeElement)) {
side = 0
if (!jsDiv) {return}
if (e.target.tagName.toLowerCase() === "a" || e.target.tagName.toLowerCase() === "d") {
e.target.focus()
if (side == 0 && focusListSecond.includes(document.activeElement)) {
side = 1
} else if (side == 1 && focusListMain.includes(document.activeElement)) {
side = 0
}
tui.updateFocus()
}
tui.updateFocus()
}
})
document.addEventListener("keydown", (e) => {
@ -326,4 +329,12 @@ document.addEventListener("keydown", (e) => {
focusListSecond[0].focus()
}*/
}
})
let resizeTimeout = 0
window.addEventListener("resize", () => {
clearTimeout(resizeTimeout)
resizeTimeout = setTimeout(() => {
document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`)
}, 200)
})