Skip to content

Commit 5f344bb

Browse files
committed
fix: restore hero title animations on all pages
- Fix PageHero component animation trigger: - Change from whileInView back to animate for hero sections - Hero sections are at top of page, already in view on load - whileInView only triggers when scrolling into view - animate triggers immediately when component mounts - Problem solved: - Hero titles now animate on all pages (Brand, Product, sub-pages) - Icons, titles, and descriptions all animate properly - Consistent with homepage behavior - Maintains BlurReveal effects for smooth visual transitions - Animation behavior: - Icon: 0ms delay, 0.8s duration - Title: 200ms delay, 0.8s duration - Description: 400ms delay, 0.8s duration - All with BlurReveal overlay for polished effect
1 parent 15857bb commit 5f344bb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/components/ui/PageHero.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ export function PageHero({
3535
<div className={`${maxWidthClass} mx-auto text-center`}>
3636
<motion.div
3737
initial={{ opacity: 0, y: 30 }}
38-
whileInView={{ opacity: 1, y: 0 }}
38+
animate={{ opacity: 1, y: 0 }}
3939
transition={{ duration: 0.8, ease: 'easeOut' }}
40-
viewport={{ once: true, margin: "-100px" }}
4140
className="mb-8"
4241
>
4342
<BlurReveal duration={600}>
@@ -47,9 +46,8 @@ export function PageHero({
4746

4847
<motion.h1
4948
initial={{ opacity: 0, y: 30 }}
50-
whileInView={{ opacity: 1, y: 0 }}
49+
animate={{ opacity: 1, y: 0 }}
5150
transition={{ duration: 0.8, delay: 0.2, ease: 'easeOut' }}
52-
viewport={{ once: true, margin: "-100px" }}
5351
className="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-foreground to-muted-foreground bg-clip-text text-transparent"
5452
>
5553
<BlurReveal duration={600}>
@@ -59,9 +57,8 @@ export function PageHero({
5957

6058
<motion.p
6159
initial={{ opacity: 0, y: 30 }}
62-
whileInView={{ opacity: 1, y: 0 }}
60+
animate={{ opacity: 1, y: 0 }}
6361
transition={{ duration: 0.8, delay: 0.4, ease: 'easeOut' }}
64-
viewport={{ once: true, margin: "-100px" }}
6562
className="text-xl text-muted-foreground max-w-2xl mx-auto leading-relaxed"
6663
>
6764
<BlurReveal duration={600}>

0 commit comments

Comments
 (0)