From 532de654e2a6b76bdda8e659330947d19ccbd22c Mon Sep 17 00:00:00 2001 From: javayhu Date: Thu, 1 May 2025 15:46:53 +0800 Subject: [PATCH] chore: optimize homepage features sections --- messages/en.json | 12 +- messages/zh.json | 26 +-- src/app/[locale]/(marketing)/(home)/page.tsx | 6 +- src/components/blocks/features/features.tsx | 2 +- src/components/blocks/features/features2.tsx | 182 ++++++------------ src/components/blocks/features/features3.tsx | 132 ++++++++----- src/components/blocks/features/features4.tsx | 71 ------- src/components/blocks/features/features5.tsx | 103 ---------- .../blocks/integration/integration.tsx | 2 +- 9 files changed, 166 insertions(+), 370 deletions(-) delete mode 100644 src/components/blocks/features/features4.tsx delete mode 100644 src/components/blocks/features/features5.tsx diff --git a/messages/en.json b/messages/en.json index ada92b4..65feb68 100644 --- a/messages/en.json +++ b/messages/en.json @@ -666,16 +666,18 @@ } } }, - "features3": { - "title": "Product Features", - "description": "Write the description of your product here, make it as detailed as possible", + "features2": { + "title": "Features2", + "subtitle": "The features of your product", + "description": "Write the description of your product here", "feature-1": "Product Feature One", "feature-2": "Product Feature Two", "feature-3": "Product Feature Three", "feature-4": "Product Feature Four" }, - "features5": { - "title": "The features of your product", + "features3": { + "title": "Features3", + "subtitle": "The features of your product", "description": "Write the description of your product here", "items": { "item-1": { diff --git a/messages/zh.json b/messages/zh.json index c574bcd..50fcc4c 100644 --- a/messages/zh.json +++ b/messages/zh.json @@ -647,7 +647,7 @@ "features": { "title": "功能", "subtitle": "您的 SaaS 产品功能", - "description": "请在详细介绍您的 SaaS 产品的特色功能的信息", + "description": "请在这里介绍您的 SaaS 产品的特色功能的信息", "items": { "item-1": { "title": "产品特色功能一", @@ -667,9 +667,19 @@ } } }, - "features5": { - "title": "您的 SaaS 产品功能", - "description": "请在详细介绍您的 SaaS 产品的特色功能的信息", + "features2": { + "title": "功能2", + "subtitle": "您的 SaaS 产品功能", + "description": "请在这里介绍您的 SaaS 产品的特色功能的信息", + "feature-1": "特色功能特点一", + "feature-2": "特色功能特点二", + "feature-3": "特色功能特点三", + "feature-4": "特色功能特点四" + }, + "features3": { + "title": "功能3", + "subtitle": "您的 SaaS 产品功能", + "description": "请在这里介绍您的 SaaS 产品的特色功能的信息", "items": { "item-1": { "title": "产品特色功能一", @@ -697,14 +707,6 @@ } } }, - "features3": { - "title": "产品特色功能", - "description": "请在详细介绍您的 SaaS 产品的特色功能的信息,尽可能详细,使其更吸引用户,提高落地页的转化率", - "feature-1": "特色功能特点一", - "feature-2": "特色功能特点二", - "feature-3": "特色功能特点三", - "feature-4": "特色功能特点四" - }, "pricing": { "title": "价格", "description": "选择最适合您的付费计划" diff --git a/src/app/[locale]/(marketing)/(home)/page.tsx b/src/app/[locale]/(marketing)/(home)/page.tsx index 8db5013..f1986fb 100644 --- a/src/app/[locale]/(marketing)/(home)/page.tsx +++ b/src/app/[locale]/(marketing)/(home)/page.tsx @@ -3,8 +3,6 @@ import FaqSection from '@/components/blocks/faqs/faqs'; import FeaturesSection from '@/components/blocks/features/features'; import Features2Section from '@/components/blocks/features/features2'; import Features3Section from '@/components/blocks/features/features3'; -import Features4Section from '@/components/blocks/features/features4'; -import Features5Section from '@/components/blocks/features/features5'; import HeroSection from '@/components/blocks/hero/hero'; import IntegrationSection from '@/components/blocks/integration/integration'; import Integration2Section from '@/components/blocks/integration/integration2'; @@ -58,9 +56,9 @@ export default async function HomePage(props: HomePageProps) { - + - + diff --git a/src/components/blocks/features/features.tsx b/src/components/blocks/features/features.tsx index 6e0867b..d2a8c60 100644 --- a/src/components/blocks/features/features.tsx +++ b/src/components/blocks/features/features.tsx @@ -23,7 +23,7 @@ import { useState } from 'react'; * https://nsui.irung.me/features * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-12.json */ -export default function Features2Section() { +export default function FeaturesSection() { const t = useTranslations('HomePage.features'); type ImageKey = 'item-1' | 'item-2' | 'item-3' | 'item-4'; const [activeItem, setActiveItem] = useState('item-1'); diff --git a/src/components/blocks/features/features2.tsx b/src/components/blocks/features/features2.tsx index 716118c..52fc9a2 100644 --- a/src/components/blocks/features/features2.tsx +++ b/src/components/blocks/features/features2.tsx @@ -1,143 +1,75 @@ -'use client'; - -import { BorderBeam } from '@/components/magicui/border-beam'; +import { HeaderSection } from '@/components/layout/header-section'; import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger, -} from '@/components/ui/accordion'; -import { - ChartBarIncreasingIcon, - Database, - Fingerprint, - IdCard, + ActivityIcon, + DraftingCompassIcon, + MailIcon, + ZapIcon, } from 'lucide-react'; -import { AnimatePresence, motion } from 'motion/react'; import { useTranslations } from 'next-intl'; import Image from 'next/image'; -import { useState } from 'react'; /** * https://nsui.irung.me/features - * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-12.json + * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-5.json */ export default function Features2Section() { - const t = useTranslations('HomePage.features'); - type ImageKey = 'item-1' | 'item-2' | 'item-3' | 'item-4'; - const [activeItem, setActiveItem] = useState('item-1'); - - const images = { - 'item-1': { - image: '/blocks/music.png', - alt: 'Product Feature One', - }, - 'item-2': { - image: '/blocks/mail2.png', - alt: 'Product Feature Two', - }, - 'item-3': { - image: '/blocks/charts.png', - alt: 'Product Feature Three', - }, - 'item-4': { - image: '/blocks/payments.png', - alt: 'Product Feature Four', - }, - }; + const t = useTranslations('HomePage.features2'); return ( -
-
-
-
-

- {t('title')} -

-

{t('description')}

-
+
+
+ -
-
-
- - - {images[activeItem].alt} - - +
+
+
+

{t('title')}

+

{t('description')}

- + +
    +
  • + + {t('feature-1')} +
  • +
  • + + {t('feature-2')} +
  • +
  • + + {t('feature-3')} +
  • +
  • + + {t('feature-4')} +
  • +
-
- setActiveItem(value as ImageKey)} - className="w-full" - > - - -
- - {t('items.item-1.title')} -
-
- - {t('items.item-1.description')} - -
- - -
- - {t('items.item-2.title')} -
-
- - {t('items.item-2.description')} - -
- - -
- - {t('items.item-3.title')} -
-
- - {t('items.item-3.description')} - -
- - -
- - {t('items.item-4.title')} -
-
- - {t('items.item-4.description')} - -
-
+
+
+ card illustration dark + card illustration light +
diff --git a/src/components/blocks/features/features3.tsx b/src/components/blocks/features/features3.tsx index 050967f..bbca850 100644 --- a/src/components/blocks/features/features3.tsx +++ b/src/components/blocks/features/features3.tsx @@ -1,66 +1,102 @@ +import { HeaderSection } from '@/components/layout/header-section'; import { - ActivityIcon, - DraftingCompassIcon, - MailIcon, + CpuIcon, + FingerprintIcon, + PencilIcon, + Settings2Icon, + SparklesIcon, ZapIcon, } from 'lucide-react'; import { useTranslations } from 'next-intl'; -import Image from 'next/image'; /** * https://nsui.irung.me/features - * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-5.json + * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-4.json */ export default function Features3Section() { const t = useTranslations('HomePage.features3'); return ( -
-
-
-
-
-

{t('title')}

-

{t('description')}

-
+
+
+ -
    -
  • - - {t('feature-1')} -
  • -
  • - - {t('feature-2')} -
  • -
  • - - {t('feature-3')} -
  • -
  • - - {t('feature-4')} -
  • -
+
+
+
+ +

+ {t('items.item-1.title')} +

+
+

+ {t('items.item-1.description')} +

- -
-
- card illustration dark - card illustration light +
+
+ +

+ {t('items.item-2.title')} +

+

+ {t('items.item-2.description')} +

+
+
+
+ + +

+ {t('items.item-3.title')} +

+
+

+ {t('items.item-3.description')} +

+
+
+
+ + +

+ {t('items.item-4.title')} +

+
+

+ {t('items.item-4.description')} +

+
+
+
+ + +

+ {t('items.item-5.title')} +

+
+

+ {t('items.item-5.description')} +

+
+
+
+ + +

+ {t('items.item-6.title')} +

+
+

+ {t('items.item-6.description')} +

diff --git a/src/components/blocks/features/features4.tsx b/src/components/blocks/features/features4.tsx deleted file mode 100644 index 543c30a..0000000 --- a/src/components/blocks/features/features4.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { - ActivityIcon, - DraftingCompassIcon, - MailIcon, - ZapIcon, -} from 'lucide-react'; -import { useTranslations } from 'next-intl'; -import Image from 'next/image'; - -/** - * Features4Section is Features3Section with a different layout - * - * https://nsui.irung.me/features - * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-5.json - */ -export default function Features4Section() { - const t = useTranslations('HomePage.features3'); - - return ( -
-
-
-
-
- payments illustration dark - payments illustration light -
-
- -
-
-

{t('title')}

-

{t('description')}

-
- -
    -
  • - - {t('feature-1')} -
  • -
  • - - {t('feature-2')} -
  • -
  • - - {t('feature-3')} -
  • -
  • - - {t('feature-4')} -
  • -
-
-
-
-
- ); -} diff --git a/src/components/blocks/features/features5.tsx b/src/components/blocks/features/features5.tsx deleted file mode 100644 index 75e0170..0000000 --- a/src/components/blocks/features/features5.tsx +++ /dev/null @@ -1,103 +0,0 @@ -import { - CpuIcon, - FingerprintIcon, - PencilIcon, - Settings2Icon, - SparklesIcon, - ZapIcon, -} from 'lucide-react'; -import { useTranslations } from 'next-intl'; - -/** - * https://nsui.irung.me/features - * pnpm dlx shadcn@canary add https://nsui.irung.me/r/features-4.json - */ -export default function Features5Section() { - const t = useTranslations('HomePage.features5'); - - return ( -
-
-
-

- {t('title')} -

-

{t('description')}

-
- -
-
-
- -

- {t('items.item-1.title')} -

-
-

- {t('items.item-1.description')} -

-
-
-
- -

- {t('items.item-2.title')} -

-
-

- {t('items.item-2.description')} -

-
-
-
- - -

- {t('items.item-3.title')} -

-
-

- {t('items.item-3.description')} -

-
-
-
- - -

- {t('items.item-4.title')} -

-
-

- {t('items.item-4.description')} -

-
-
-
- - -

- {t('items.item-5.title')} -

-
-

- {t('items.item-5.description')} -

-
-
-
- - -

- {t('items.item-6.title')} -

-
-

- {t('items.item-6.description')} -

-
-
-
-
- ); -} diff --git a/src/components/blocks/integration/integration.tsx b/src/components/blocks/integration/integration.tsx index c81c104..276de6f 100644 --- a/src/components/blocks/integration/integration.tsx +++ b/src/components/blocks/integration/integration.tsx @@ -90,7 +90,7 @@ const IntegrationCard = ({ const t = useTranslations('HomePage.integration'); return ( - +
{children}