From b4e3250c5edf3f5487178cd1250566bca0218f64 Mon Sep 17 00:00:00 2001 From: memdmp Date: Thu, 9 Apr 2026 18:12:12 +0200 Subject: fix: use appropriate units --- src/app.css | 2 +- src/routes/anim-gen.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/app.css b/src/app.css index 558d9b0..4e82df1 100644 --- a/src/app.css +++ b/src/app.css @@ -193,7 +193,7 @@ @apply bg-codeblock-background -my-1 p-1 rounded-lg; } pre { - @apply p-3 -mx-2 overflow-scroll bg-codeblock-background border border-codeblock-border rounded-lg transition-colors max-h-[min(75vh,38rem)]; + @apply p-3 -mx-2 overflow-scroll bg-codeblock-background border border-codeblock-border rounded-lg transition-colors max-h-[min(75dvh,38rem)]; code { .token { @apply text-red-500; diff --git a/src/routes/anim-gen.ts b/src/routes/anim-gen.ts index 49c9cbd..883744f 100644 --- a/src/routes/anim-gen.ts +++ b/src/routes/anim-gen.ts @@ -32,8 +32,8 @@ const visibleStageStyles = `margin-top: 0; margin-bottom: 0; margin-left: 0; margin-right: 0; -height: 100vh; -width: 100vw; +height: 100dvh; +width: 100dvw; opacity: 1;`; const hiddenStageStyles = `margin-top: -99999vh; margin-bottom: 99999vh; @@ -58,8 +58,8 @@ const altHiddenStyles = `opacity:0; transform:scaleX(0); width:0; height:0; -margin-left:-100vw; -margin-right:100vw;`; +margin-left:-100dvw; +margin-right:100dvw;`; const altVisibleStyles = `opacity:1; transform:none; width:max-content; @@ -105,10 +105,10 @@ const biosStepHandlers: Step[] = [ (next: () => void) => { const s = anim.selector(`.anmroot #bios .bar`); s.style(`${index === 0 ? hiddenStyles : visibleStyles} -width: ${lastQuantity * 100}vw;`); +width: ${lastQuantity * 100}dvw;`); anim._internal_timeline.now += 1; s.style(`${visibleStyles} -width: ${quantity * 100}vw;`); +width: ${quantity * 100}dvw;`); anim.in(quantity === 1 ? 50 : biosStepInterval, next); }, ) @@ -288,7 +288,7 @@ max-height: 0;`); if (idx === arr.length - 1) { anim .selector('#openrc .openrc-hide-at-last-boot-step') - .style('opacity:1;max-height:90vh;max-width:100vw;'); + .style('opacity:1;max-height:90dvh;max-width:100dvw;'); } anim._internal_timeline.now += 1; if (idx === arr.length - 1) { @@ -457,8 +457,8 @@ ${hiddenStageStyles} opacity: 0; width: 0; height: 0; - margin-left: -100vw; - margin-right: 100vw; + margin-left: -100dvw; + margin-right: 100dvw; } ${ttyLines .flatMap((v) => -- cgit v1.2.3