From 864e559618d2b151d2c85b10277ef69d75773e9a Mon Sep 17 00:00:00 2001 From: "Mr. M" Date: Sat, 31 May 2025 00:47:26 +0200 Subject: [PATCH] Refactor homepage components: replace Features with HomepageFeatures and add HomepageFeature component for better structure and functionality --- src/components/HomepageFeature.astro | 45 +++++++++++++++ src/components/HomepageFeatures.astro | 79 +++++++++++++++++++++++++++ src/pages/[...locale]/index.astro | 4 +- 3 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 src/components/HomepageFeature.astro create mode 100644 src/components/HomepageFeatures.astro diff --git a/src/components/HomepageFeature.astro b/src/components/HomepageFeature.astro new file mode 100644 index 0000000..6a9394d --- /dev/null +++ b/src/components/HomepageFeature.astro @@ -0,0 +1,45 @@ + +--- +import { motion } from 'motion/react' +import { getTitleAnimation } from '~/animations' +import Description from './Description.astro' +import Video from './Video.astro' + +const { title, video, description, alt, id } = Astro.props +--- + +
+
+ + + {title} + + + + {description} + +
+ + +
diff --git a/src/components/HomepageFeatures.astro b/src/components/HomepageFeatures.astro new file mode 100644 index 0000000..c50abd3 --- /dev/null +++ b/src/components/HomepageFeatures.astro @@ -0,0 +1,79 @@ +--- +import { getLocale, getUI } from '~/utils/i18n' +import HomepageFeature from './HomepageFeature.astro' +const locale = getLocale(Astro) + +import CompactModeVideo from '~/assets/CompactMode.webm' +import GlanceVideo from '~/assets/Glance.webm' +import SplitViewsVideo from '~/assets/SplitViews.webm' +import WorkspacesVideo from '~/assets/Workspaces.webm' + +const { + routes: { + index: { features }, + }, +} = getUI(locale) +--- + + + + + + + + diff --git a/src/pages/[...locale]/index.astro b/src/pages/[...locale]/index.astro index 9932584..15ffb1d 100644 --- a/src/pages/[...locale]/index.astro +++ b/src/pages/[...locale]/index.astro @@ -1,7 +1,7 @@ --- import Community from '~/components/Community.astro' -import Features from '~/components/Features.astro' import Hero from '~/components/Hero.astro' +import HomepageFeatures from '~/components/HomepageFeatures.astro' import Sponsors from '~/components/Sponsors.astro' import Layout from '~/layouts/Layout.astro' import { getLocale, getUI } from '~/utils/i18n' @@ -19,7 +19,7 @@ const { layout } = getUI(locale) >
- +