diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index 0d807db..f00273e 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -109,7 +109,7 @@ const bannerOffset =
/>
))}
-
@@ -160,7 +165,6 @@ const bannerOffset =
bannerOffset,
'banner-height-home': `${BANNER_HEIGHT_HOME}vh`,
'banner-height': `${BANNER_HEIGHT}vh`,
- 'banner-height-extend': `${BANNER_HEIGHT_EXTEND}vh`
}}>
@tailwind components;
@layer components {
@@ -459,6 +463,13 @@ function scrollFunction() {
}
window.onscroll = scrollFunction
+// calculate the --banner-height-extend, which needs to be a multiple of 4 to avoid blurry text
+window.onresize = () => {
+ let offset = Math.floor(window.innerHeight * (BANNER_HEIGHT_EXTEND / 100));
+ offset = offset - offset % 4;
+ document.documentElement.style.setProperty('--banner-height-extend', `${offset}px`);
+}
+