fix(home): equalize process cards after fonts load
- deferred height-equalization script in `HomeProcess.astro` to `document.fonts.ready` - card heights now measured with correct web fonts in all environments, not just Vite dev server
This commit is contained in:
@@ -24,6 +24,8 @@ const { section } = Astro.props;
|
|||||||
const max = Math.max(...cards.map(c => c.offsetHeight));
|
const max = Math.max(...cards.map(c => c.offsetHeight));
|
||||||
if (max > 0) cards.forEach(c => (c.style.height = `${max}px`));
|
if (max > 0) cards.forEach(c => (c.style.height = `${max}px`));
|
||||||
}
|
}
|
||||||
|
document.fonts.ready.then(() => {
|
||||||
equalizeProcessCards();
|
equalizeProcessCards();
|
||||||
window.addEventListener('resize', equalizeProcessCards);
|
window.addEventListener('resize', equalizeProcessCards);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user