diff options
fix: use appropriate units
| -rw-r--r-- | src/app.css | 2 | ||||
| -rw-r--r-- | src/routes/anim-gen.ts | 18 | ||||
| -rw-r--r-- | tsconfig.json | 1 |
3 files changed, 11 insertions, 10 deletions
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) => diff --git a/tsconfig.json b/tsconfig.json index 593dc19..027c1f8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,7 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, + "allowImportingTsExtensions": true, "moduleResolution": "bundler" } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias |