From 4d247cfb930cdc45f2f4b8a80a8e225c39aeac75 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Mon, 19 May 2025 14:54:59 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20reducemotion=20config?= =?UTF-8?q?=20option=20to=20optimize=20performance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add `reduceMotion` option in theme config to improve performance - Update Button component to support reduced animations - Modify GSAP animation logic to adapt to the new configuration - Update documentation to reflect the new feature --- src/components/Button.astro | 15 ++++++-- src/components/Widgets/GsapAnimation.astro | 35 ++++++++++++------- src/config.ts | 8 +++-- src/content/posts/guides/Theme Guide-en.md | 8 +++-- src/content/posts/guides/Theme Guide-es.md | 8 +++-- src/content/posts/guides/Theme Guide-ja.md | 8 +++-- src/content/posts/guides/Theme Guide-ru.md | 8 +++-- src/content/posts/guides/Theme Guide-zh-tw.md | 8 +++-- src/content/posts/guides/Theme Guide-zh.md | 8 +++-- src/layouts/Layout.astro | 5 ++- src/styles/transition.css | 5 ++- src/types/index.d.ts | 3 +- 12 files changed, 77 insertions(+), 42 deletions(-) diff --git a/src/components/Button.astro b/src/components/Button.astro index a752c10..2654096 100644 --- a/src/components/Button.astro +++ b/src/components/Button.astro @@ -10,6 +10,7 @@ interface Props { } const { light: { background: lightMode }, dark: { background: darkMode } } = themeConfig.color +const reduceMotion = themeConfig.global.reduceMotion const { supportedLangs } = Astro.props const currentPath = Astro.url.pathname @@ -61,7 +62,10 @@ const nextUrl = useSupportedLangs -