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

@ -1,7 +1,7 @@
@import url(fonts.css); @import url(fonts.css);
:root { :root {
--vh: 1vh --vh: 1vh;
} }
html { html {
@ -30,6 +30,10 @@ p, d {
margin-bottom: 0 margin-bottom: 0
} }
d:not(d:only-child):hover {
color: var(--c-bg); background-color: var(--c-fg)
}
a { a {
font-family: "mono"; font-family: "mono";
color: var(--c-highlight); color: var(--c-highlight);
@ -105,26 +109,16 @@ li {
} }
} }
@media screen and (min-width: 420px) and (max-width: 649px) {
.ascii-2 {
display: block !important
}
}
@media screen and (min-width: 650px) {
.ascii-1 {
display: block !important
}
}
/* styling for the basic border when no js */ /* styling for the basic border when no js */
body > .nojs { body > .nojs {
border: 2px solid var(--c-border);
box-sizing: border-box;
position: fixed;
width: calc(100vw - 16px); width: calc(100vw - 16px);
height: calc(var(--vh) * 100 - 16px); height: calc(var(--vh) * 100 - 16px);
box-sizing: border-box; top: 8px;
border: 8px double var(--c-border); left: 8px
overflow: hidden
} }
main, .js > div > div { main, .js > div > div {
@ -135,6 +129,21 @@ main, .js > div > div {
box-sizing: border-box; box-sizing: border-box;
} }
main {
overflow-y: auto !important
}
.nojs li > :is(a, d):hover + p {
visibility: visible;
display: block;
position: fixed;
box-sizing: border-box;
padding: 16px;
margin-top: 0;
margin-bottom: 0;
overflow: hidden
}
/* styling for the js mode! */ /* styling for the js mode! */
.js { .js {
visibility: hidden; visibility: hidden;
@ -147,21 +156,23 @@ main, .js > div > div {
left: 8px left: 8px
} }
.js > div { .js > div, .nojs > :is(div, main) {
box-sizing: border-box; box-sizing: border-box;
border: 2px solid var(--c-border); border: 2px solid var(--c-border);
overflow: hidden; overflow: hidden;
position: fixed; position: fixed;
} }
/* stuff for shaping squares */
@media screen and (min-aspect-ratio: 1/1) { @media screen and (min-aspect-ratio: 1/1) {
.js > div:first-child { :is(.js, .nojs) > :is(div:first-child, main) {
width: calc(50vw - 4px - 11px); width: calc(50vw - 4px - 11px);
height: calc(var(--vh) * 100 - 16px - 10px); height: calc(var(--vh) * 100 - 16px - 10px);
top: 13px; top: 13px;
left: 13px left: 13px
} }
.js > div:last-child { :is(.js, .nojs) > div:last-child, .nojs li > :is(a, d):hover + p {
width: calc(50vw - 4px - 11px); width: calc(50vw - 4px - 11px);
height: calc(var(--vh) * 100 - 16px - 10px); height: calc(var(--vh) * 100 - 16px - 10px);
top: 13px; top: 13px;
@ -174,13 +185,13 @@ main, .js > div > div {
} }
@media screen and (max-aspect-ratio: 1000/1001) { @media screen and (max-aspect-ratio: 1000/1001) {
.js > div:first-child { :is(.js, .nojs) > :is(div:first-child, main) {
width: calc(100vw - 16px - 10px); width: calc(100vw - 16px - 10px);
height: calc(var(--vh) * 50 - 4px - 11px); height: calc(var(--vh) * 50 - 4px - 11px);
top: 13px; top: 13px;
left: 13px left: 13px
} }
.js > div:last-child { :is(.js, .nojs) > div:last-child, .nojs li > :is(a, d):hover + p {
width: calc(100vw - 16px - 10px); width: calc(100vw - 16px - 10px);
height: calc(var(--vh) * 50 - 4px - 11px); height: calc(var(--vh) * 50 - 4px - 11px);
bottom: 13px; bottom: 13px;
@ -192,6 +203,16 @@ main, .js > div > div {
} }
} }
@media (max-width: 430px) and (max-height: 430px) {
.nojs > div:last-child, .nojs li > :is(a, d):hover + p {
display: none !important
}
.nojs > main {
width: calc(100vw - 16px - 10px) !important;
height: calc(var(--vh) * 100 - 16px - 10px) !important;
}
}
.js > div:only-child { .js > div:only-child {
width: calc(100vw - 16px - 10px); width: calc(100vw - 16px - 10px);
height: calc(var(--vh) * 100 - 16px - 10px); height: calc(var(--vh) * 100 - 16px - 10px);
@ -199,6 +220,8 @@ main, .js > div > div {
left: 13px left: 13px
} }
/* buttons and focus */
.buttons { .buttons {
white-space: pre; white-space: pre;
margin-left: 24px margin-left: 24px

View file

@ -15,7 +15,9 @@ back.innerHTML = `⬑Back`
window.addEventListener("load", () => { window.addEventListener("load", () => {
stylesheet = document.styleSheets[0]; 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 // randomize loading text
fetch("/assets/loading.txt") fetch("/assets/loading.txt")
@ -29,13 +31,15 @@ window.addEventListener("load", () => {
document.body.appendChild(skipNode); document.body.appendChild(skipNode);
// get rid of shit since we have javascript babyyyyyyy // 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")) { for (let node of document.getElementsByClassName("nojs")) {
node.style.display = "none" node.style.display = "none"
} }
stylesheet.insertRule(".js { visibility: visible }", stylesheet.cssRules.length) stylesheet.insertRule(".js { visibility: visible }", stylesheet.cssRules.length)
stylesheet.insertRule(".skip-notice { opacity: 1 }", 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("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()); document.querySelectorAll("head style").forEach(style => style.remove());
jsDiv = document.getElementsByClassName("js")[0] jsDiv = document.getElementsByClassName("js")[0]

27
assets/nojs-atmedia.css Normal file
View file

@ -0,0 +1,27 @@
@media screen and (min-aspect-ratio: 1000/1000) {
@media screen and (min-width: 840px) and (max-width: 1299px) {
.ascii-2 {
display: block !important
}
}
@media screen and (min-width: 1300px) {
.ascii-1 {
display: block !important
}
}
}
@media screen and (max-aspect-ratio: 1000/1001) {
@media screen and (min-width: 420px) and (max-width: 649px) {
.ascii-2 {
display: block !important
}
}
@media screen and (min-width: 650px) {
.ascii-1 {
display: block !important
}
}
}

View file

@ -7,6 +7,7 @@
<link rel="stylesheet" href="/assets/base.css"> <link rel="stylesheet" href="/assets/base.css">
<link rel="stylesheet" href="/assets/animations.css"> <link rel="stylesheet" href="/assets/animations.css">
<link rel="stylesheet" href="/assets/colors.css"> <link rel="stylesheet" href="/assets/colors.css">
<link rel="stylesheet" href="/assets/nojs-atmedia.css">
<style>a:hover { color: var(--c-bg); background-color: var(--c-highlight) }</style> <style>a:hover { color: var(--c-bg); background-color: var(--c-highlight) }</style>
<link rel="icon" href="/assets/molly.svg"> <link rel="icon" href="/assets/molly.svg">
</head> </head>
@ -65,7 +66,7 @@
<li><a href="https://cinny.linuxposting.xyz">Cinny</a><p>The good matrix client</p></li> <li><a href="https://cinny.linuxposting.xyz">Cinny</a><p>The good matrix client</p></li>
<li><a href="https://element.linuxposting.xyz">Element</a><p>The bad matrix client. But it has LaTeX, in case you're into that.</p></li> <li><a href="https://element.linuxposting.xyz">Element</a><p>The bad matrix client. But it has LaTeX, in case you're into that.</p></li>
</ul> </ul>
</main></div> </main><div><span class="title2">Description</span></div></div>
<div class="js skip"><div></div></div> <div class="js skip"><div></div></div>
<span class="credit skip"><a href="https://girlkissing.tips" id="credit">site by Magdalunaa :3</a></span> <span class="credit skip"><a href="https://girlkissing.tips" id="credit">site by Magdalunaa :3</a></span>
<span class="skip-notice skip">Click / space to skip</span> <span class="skip-notice skip">Click / space to skip</span>