From 858237af66725f447fcb6bc58a1dc86a75dcc663 Mon Sep 17 00:00:00 2001 From: Pagwin Date: Mon, 25 Aug 2025 22:27:31 -0400 Subject: [PATCH] fixed layout fuckup which messed up mobile --- posts/fractions_sidequest.md | 6 +++--- static/css/layout.css | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/posts/fractions_sidequest.md b/posts/fractions_sidequest.md index bee173d..76042a6 100644 --- a/posts/fractions_sidequest.md +++ b/posts/fractions_sidequest.md @@ -72,7 +72,7 @@ impl Add for Frac{ This code feels bad even from a code quality point of view but idk why, regardless it's hilariously bad performance wise. - + Considering that we're "only" doing addition this is incredibly slow. Slower than addition in (insert butt of the joke language of this week here). All that in mind something is definitely up and if you read the code above and think about it enough you'll probably see it. @@ -154,7 +154,7 @@ async fn recurse(f1:Frac,f2:Frac, remaining:u64)->Vec{ looks good at first glance(actual version code quality is bad but blog version seems alright). What happens when we run it? - + Oh... we run out of memory... or well we run out of 30 gigabytes of memory because I set a limit to avoid affecting the other stuff running on the server(because it isn't mine). But why? Doing the math if all we had to deal with was the fractions we'd be using about `17501876*4/1000**3 ~ 0.07 GB`, if we include the overhead of all the Vecs we make and are pretty agressive with how much memory they use maybe 0.21 GB which is a difference of over 142x. So what's the rest of the memory? @@ -196,7 +196,7 @@ fn recurse(f1:Frac,f2:Frac, remaining:u64)->Vec{ This solves the whole running out of memory thing. A funny side effect is that now it's even faster(even though it's 1 thread). - + So that was fun going through and making all this work out well, now I can generate gigabytes upon gigabytes of fractions with ease. diff --git a/static/css/layout.css b/static/css/layout.css index ff3daff..137160e 100644 --- a/static/css/layout.css +++ b/static/css/layout.css @@ -145,8 +145,13 @@ header#header { padding: 0.5em 1em; } article { - max-width: 66ch; + max-width: min(66ch, 100vw); width: 100%; + padding: 1rem; +} +video, img { + max-width: -moz-available; + max-width: fill-available; } main { box-sizing: border-box;