fix: resolve gsap animation flash on page load

- Add initial state styles for animated elements in CSS
- Change GSAP animations from .from() to .to() method
- Move reduce-motion class from JS to server-side HTML
- Improve performance by eliminating DOM flash
- Enhance code readability with better formatting
This commit is contained in:
radishzzz 2025-05-26 11:12:47 +01:00
parent ead71483ec
commit c1996585a8
5 changed files with 68 additions and 43 deletions

View file

@ -33,7 +33,11 @@ const MarginBottom = isPost && themeConfig.comment?.enabled
<html
lang={Astro.currentLocale}
class:list={[fontStyle, { 'scroll-smooth': isPost }]}
class:list={[
fontStyle,
{ 'scroll-smooth': isPost },
{ 'reduce-motion': themeConfig.global.reduceMotion },
]}
>
<Head {postTitle} {postDescription} {postSlug} />
<body>