Skip to content

Commit 11021a9

Browse files
committed
feat: create reusable PageHero and SectionHeader components
- Create PageHero component for consistent page intro sections - Supports icon, title, description with configurable max width - Uses BlurReveal for consistent animation across all hero sections - Replaces repetitive motion.div patterns across pages - Create SectionHeader component for consistent section titles - Supports title, description with configurable sizes and alignment - Uses BlurReveal + SectionTitle for consistent styling - Replaces repetitive section header patterns - Update all pages to use new components: - Brand page: PageHero with Award icon - Product page: PageHero with Code icon - UX-patterns page: PageHero + SectionHeader for all sections - Visual-patterns page: PageHero + SectionHeader for all sections - Workflow-rituals page: PageHero + SectionHeader for all sections - Benefits: - Consistent BlurReveal animation across all headers - Reduced code duplication and improved maintainability - Unified styling and animation timing - Easy to update header styles globally - Type-safe component interfaces - Clean up unused imports and optimize bundle size
1 parent ae59081 commit 11021a9

File tree

8 files changed

+198
-272
lines changed

8 files changed

+198
-272
lines changed

src/app/brand/page.tsx

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import Footer from '@/components/layout/Footer';
55
import SectionNavigation from '@/components/ui/SectionNavigation';
66
import SectionPlaceholder from '@/components/ui/SectionPlaceholder';
77
import { AnimatedSection } from '@/components/ui/AnimatedSection';
8+
import { PageHero } from '@/components/ui/PageHero';
89
import { Award, FileText, Download } from 'lucide-react';
910
import { useLanguage } from '@/contexts/LanguageContext';
10-
import { motion } from 'framer-motion';
1111

1212
export default function BrandPage() {
1313
const { t } = useLanguage();
@@ -25,36 +25,12 @@ export default function BrandPage() {
2525
<SectionNavigation sections={sections} />
2626

2727
{/* Intro Screen */}
28-
<section className="min-h-screen flex items-center justify-center px-4 sm:px-6 lg:px-8">
29-
<div className="max-w-4xl mx-auto text-center">
30-
<motion.div
31-
initial={{ opacity: 0, y: 30 }}
32-
animate={{ opacity: 1, y: 0 }}
33-
transition={{ duration: 0.8, ease: 'easeOut' }}
34-
className="mb-8"
35-
>
36-
<Award className="w-16 h-16 text-white mx-auto mb-6" />
37-
</motion.div>
38-
39-
<motion.h1
40-
initial={{ opacity: 0, y: 30 }}
41-
animate={{ opacity: 1, y: 0 }}
42-
transition={{ duration: 0.8, delay: 0.2, ease: 'easeOut' }}
43-
className="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent"
44-
>
45-
{t('nav.brand')}
46-
</motion.h1>
47-
48-
<motion.p
49-
initial={{ opacity: 0, y: 30 }}
50-
animate={{ opacity: 1, y: 0 }}
51-
transition={{ duration: 0.8, delay: 0.4, ease: 'easeOut' }}
52-
className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed"
53-
>
54-
{t('brand.intro.catchphrase')}
55-
</motion.p>
56-
</div>
57-
</section>
28+
<PageHero
29+
icon={Award}
30+
title={t('nav.brand')}
31+
description={t('brand.intro.catchphrase')}
32+
maxWidth="4xl"
33+
/>
5834

5935
<div id="principles" className="min-h-screen flex items-center justify-center scroll-mt-24">
6036
<AnimatedSection delay={0.1}>

src/app/product/UX-patterns/page.tsx

Lines changed: 20 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import { useRouter } from 'next/navigation';
77
import Header from '@/components/layout/Header';
88
import Footer from '@/components/layout/Footer';
99
import SectionNavigation from '@/components/ui/SectionNavigation';
10-
import { SectionTitle } from '@/components/ui/SectionTitle';
11-
import { BlurReveal } from '@/components/ui/BlurReveal';
12-
import { AnimatedSection } from '@/components/ui/AnimatedSection';
10+
import { PageHero } from '@/components/ui/PageHero';
11+
import { SectionHeader } from '@/components/ui/SectionHeader';
1312
import PatternAccordion from '@/components/ui/PatternAccordion';
1413
import { interactionPatterns } from '@/data/interactionPatterns';
1514

@@ -45,52 +44,20 @@ const UXPatternsPage = () => {
4544
</div>
4645

4746
{/* Intro Screen */}
48-
<section className="min-h-screen flex items-center justify-center px-4 sm:px-6 lg:px-8">
49-
<div className="max-w-7xl mx-auto text-center">
50-
<motion.div
51-
initial={{ opacity: 0, y: 30 }}
52-
animate={{ opacity: 1, y: 0 }}
53-
transition={{ duration: 0.8, ease: 'easeOut' }}
54-
className="mb-8"
55-
>
56-
<MousePointer className="w-16 h-16 text-white mx-auto mb-6" />
57-
</motion.div>
58-
59-
<motion.h1
60-
initial={{ opacity: 0, y: 30 }}
61-
animate={{ opacity: 1, y: 0 }}
62-
transition={{ duration: 0.8, delay: 0.2, ease: 'easeOut' }}
63-
className="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent"
64-
>
65-
UX Patterns
66-
</motion.h1>
67-
68-
<motion.p
69-
initial={{ opacity: 0, y: 30 }}
70-
animate={{ opacity: 1, y: 0 }}
71-
transition={{ duration: 0.8, delay: 0.4, ease: 'easeOut' }}
72-
className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed"
73-
>
74-
{t('product.guidelines.uxPatterns.description')}
75-
</motion.p>
76-
</div>
77-
</section>
47+
<PageHero
48+
icon={MousePointer}
49+
title="UX Patterns"
50+
description={t('product.guidelines.uxPatterns.description')}
51+
maxWidth="7xl"
52+
/>
7853

7954
<div id="interaction-patterns" className="scroll-mt-24">
8055
<section className="py-20 px-4 sm:px-6 lg:px-8">
8156
<div className="max-w-7xl mx-auto">
82-
<AnimatedSection className="text-center mb-16" delay={0.1}>
83-
<BlurReveal>
84-
<SectionTitle>
85-
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
86-
Interaction Patterns
87-
</h2>
88-
<p className="text-xl text-muted-foreground max-w-3xl mx-auto">
89-
{t('product.guidelines.uxPatterns.description')}
90-
</p>
91-
</SectionTitle>
92-
</BlurReveal>
93-
</AnimatedSection>
57+
<SectionHeader
58+
title="Interaction Patterns"
59+
description={t('product.guidelines.uxPatterns.description')}
60+
/>
9461

9562
{/* Best Practices & Dark Patterns */}
9663
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-12">
@@ -149,18 +116,10 @@ const UXPatternsPage = () => {
149116
<div id="ui-kit" className="scroll-mt-24">
150117
<section className="py-20 px-4 sm:px-6 lg:px-8">
151118
<div className="max-w-7xl mx-auto">
152-
<AnimatedSection className="text-center mb-16" delay={0.1}>
153-
<BlurReveal>
154-
<SectionTitle>
155-
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
156-
UI Kit
157-
</h2>
158-
<p className="text-xl text-muted-foreground max-w-3xl mx-auto">
159-
From atoms to modules to views - our comprehensive design system components.
160-
</p>
161-
</SectionTitle>
162-
</BlurReveal>
163-
</AnimatedSection>
119+
<SectionHeader
120+
title="UI Kit"
121+
description="From atoms to modules to views - our comprehensive design system components."
122+
/>
164123

165124
{/* UI Kit Structure */}
166125
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
@@ -192,18 +151,10 @@ const UXPatternsPage = () => {
192151
<div id="micro-interactions" className="scroll-mt-24">
193152
<section className="py-20 px-4 sm:px-6 lg:px-8">
194153
<div className="max-w-7xl mx-auto">
195-
<AnimatedSection className="text-center mb-16" delay={0.1}>
196-
<BlurReveal>
197-
<SectionTitle>
198-
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
199-
Micro-interactions
200-
</h2>
201-
<p className="text-xl text-muted-foreground max-w-3xl mx-auto">
202-
Delightful details that bring our interfaces to life.
203-
</p>
204-
</SectionTitle>
205-
</BlurReveal>
206-
</AnimatedSection>
154+
<SectionHeader
155+
title="Micro-interactions"
156+
description="Delightful details that bring our interfaces to life."
157+
/>
207158

208159
{/* Micro-interactions Examples */}
209160
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">

src/app/product/page.tsx

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import ProductPrinciples from '@/components/product/ProductPrinciples';
77
import ProductGuidelines from '@/components/product/ProductGuidelines';
88
import SectionPlaceholder from '@/components/ui/SectionPlaceholder';
99
import { AnimatedSection } from '@/components/ui/AnimatedSection';
10+
import { PageHero } from '@/components/ui/PageHero';
1011
import { Download, Code } from 'lucide-react';
1112
import { useLanguage } from '@/contexts/LanguageContext';
12-
import { motion } from 'framer-motion';
1313

1414
export default function ProductPage() {
1515
const { t } = useLanguage();
@@ -27,36 +27,12 @@ export default function ProductPage() {
2727
<SectionNavigation sections={sections} />
2828

2929
{/* Intro Screen */}
30-
<section className="min-h-screen flex items-center justify-center px-4 sm:px-6 lg:px-8">
31-
<div className="max-w-7xl mx-auto text-center">
32-
<motion.div
33-
initial={{ opacity: 0, y: 30 }}
34-
animate={{ opacity: 1, y: 0 }}
35-
transition={{ duration: 0.8, ease: 'easeOut' }}
36-
className="mb-8"
37-
>
38-
<Code className="w-16 h-16 text-white mx-auto mb-6" />
39-
</motion.div>
40-
41-
<motion.h1
42-
initial={{ opacity: 0, y: 30 }}
43-
animate={{ opacity: 1, y: 0 }}
44-
transition={{ duration: 0.8, delay: 0.2, ease: 'easeOut' }}
45-
className="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent"
46-
>
47-
{t('nav.product')}
48-
</motion.h1>
49-
50-
<motion.p
51-
initial={{ opacity: 0, y: 30 }}
52-
animate={{ opacity: 1, y: 0 }}
53-
transition={{ duration: 0.8, delay: 0.4, ease: 'easeOut' }}
54-
className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed"
55-
>
56-
{t('product.intro.catchphrase')}
57-
</motion.p>
58-
</div>
59-
</section>
30+
<PageHero
31+
icon={Code}
32+
title={t('nav.product')}
33+
description={t('product.intro.catchphrase')}
34+
maxWidth="7xl"
35+
/>
6036

6137
<div id="principles" className="min-h-screen flex items-center justify-center scroll-mt-24">
6238
<AnimatedSection delay={0.1}>

src/app/product/visual-patterns/page.tsx

Lines changed: 16 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import { useRouter } from 'next/navigation';
77
import Header from '@/components/layout/Header';
88
import Footer from '@/components/layout/Footer';
99
import SectionNavigation from '@/components/ui/SectionNavigation';
10-
import { SectionTitle } from '@/components/ui/SectionTitle';
11-
import { BlurReveal } from '@/components/ui/BlurReveal';
12-
import { AnimatedSection } from '@/components/ui/AnimatedSection';
10+
import { PageHero } from '@/components/ui/PageHero';
11+
import { SectionHeader } from '@/components/ui/SectionHeader';
1312

1413
const VisualPatternsPage = () => {
1514
const { t } = useLanguage();
@@ -49,58 +48,20 @@ const VisualPatternsPage = () => {
4948
</div>
5049

5150
{/* Intro Screen */}
52-
<section className="min-h-screen flex items-center justify-center px-4 sm:px-6 lg:px-8">
53-
<div className="max-w-7xl mx-auto text-center">
54-
<motion.div
55-
initial={{ opacity: 0, y: 30 }}
56-
animate={{ opacity: 1, y: 0 }}
57-
transition={{ duration: 0.8, ease: 'easeOut' }}
58-
className="mb-8"
59-
>
60-
<Eye className="w-16 h-16 text-white mx-auto mb-6" />
61-
</motion.div>
62-
63-
<motion.h1
64-
initial={{ opacity: 0, y: 30 }}
65-
animate={{ opacity: 1, y: 0 }}
66-
transition={{ duration: 0.8, delay: 0.2, ease: 'easeOut' }}
67-
className="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent"
68-
>
69-
Visual Patterns
70-
</motion.h1>
71-
72-
<motion.p
73-
initial={{ opacity: 0, y: 30 }}
74-
animate={{ opacity: 1, y: 0 }}
75-
transition={{ duration: 0.8, delay: 0.4, ease: 'easeOut' }}
76-
className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed"
77-
>
78-
{t('product.guidelines.visualPatterns.description')}
79-
</motion.p>
80-
</div>
81-
</section>
51+
<PageHero
52+
icon={Eye}
53+
title="Visual Patterns"
54+
description={t('product.guidelines.visualPatterns.description')}
55+
maxWidth="7xl"
56+
/>
8257

8358
<div id="principles" className="scroll-mt-24">
8459
<section className="py-20 px-4 sm:px-6 lg:px-8">
8560
<div className="max-w-7xl mx-auto">
86-
<motion.div
87-
initial={{ opacity: 0, y: 30 }}
88-
whileInView={{ opacity: 1, y: 0 }}
89-
transition={{ duration: 0.6 }}
90-
viewport={{ once: true }}
91-
className="text-center mb-16"
92-
>
93-
<BlurReveal>
94-
<SectionTitle>
95-
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
96-
Design Principles
97-
</h2>
98-
<p className="text-xl text-muted-foreground max-w-3xl mx-auto">
99-
{t('product.guidelines.visualPatterns.subtitle')}
100-
</p>
101-
</SectionTitle>
102-
</BlurReveal>
103-
</motion.div>
61+
<SectionHeader
62+
title="Design Principles"
63+
description={t('product.guidelines.visualPatterns.subtitle')}
64+
/>
10465

10566
{/* Principles Grid */}
10667
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
@@ -131,26 +92,10 @@ const VisualPatternsPage = () => {
13192
<div id="guidelines" className="min-h-screen flex items-center justify-center scroll-mt-24">
13293
<section className="py-20 px-4 sm:px-6 lg:px-8">
13394
<div className="max-w-7xl mx-auto text-center">
134-
<motion.div
135-
initial={{ opacity: 0, y: 30 }}
136-
whileInView={{ opacity: 1, y: 0 }}
137-
transition={{ duration: 0.6 }}
138-
viewport={{ once: true }}
139-
className="mb-8"
140-
>
141-
<Eye className="w-16 h-16 text-white mx-auto mb-6" />
142-
</motion.div>
143-
144-
<BlurReveal>
145-
<SectionTitle>
146-
<h2 className="text-4xl md:text-5xl font-bold text-white mb-6">
147-
Visual Guidelines
148-
</h2>
149-
<p className="text-xl text-muted-foreground max-w-3xl mx-auto">
150-
Comprehensive visual standards and brand integration guidelines.
151-
</p>
152-
</SectionTitle>
153-
</BlurReveal>
95+
<SectionHeader
96+
title="Visual Guidelines"
97+
description="Comprehensive visual standards and brand integration guidelines."
98+
/>
15499
</div>
155100
</section>
156101
</div>

0 commit comments

Comments
 (0)