Skip to content

Commit 1e42b85

Browse files
committed
Refactor: Enhance hero section animations and layout, streamline main content and footer structure, and remove mock agency data and custom cursor.
1 parent 3ce9a67 commit 1e42b85

4 files changed

Lines changed: 55 additions & 112 deletions

File tree

src/app/page.tsx

Lines changed: 48 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { gsap, useGSAP } from '@/lib/gsap'
1212
import { getAssetPath } from '@/lib/utils'
1313
import SplitType from 'split-type'
1414
import { RequestSection } from '@/components/home/RequestSection'
15-
import { CustomCursor } from '@/components/ui/CustomCursor'
15+
1616

1717
export default function Home() {
1818
const heroRef = useRef<HTMLElement>(null)
@@ -63,83 +63,60 @@ export default function Home() {
6363
// ── Hero animations ──
6464
const tl = gsap.timeline({ defaults: { ease: 'power4.out' } })
6565

66-
// Initial Reveal
66+
// Background (Independent)
67+
tl.to('.hero-bg-mountains img', {
68+
scale: 1.1,
69+
duration: 20,
70+
ease: 'none',
71+
}, 0)
72+
73+
// Title Reveal
6774
if (titleRef.current) {
6875
const split = new SplitType(titleRef.current, {
6976
types: 'words',
7077
tagName: 'span'
7178
})
7279

73-
// Background gentle zoom
74-
tl.to('.hero-bg-mountains img', {
75-
scale: 1.1,
76-
duration: 20,
77-
ease: 'none',
78-
}, 0)
79-
80-
// Text Reveal
8180
tl.from(split.words, {
8281
yPercent: 100,
8382
opacity: 0,
84-
stagger: 0.08,
85-
duration: 1.2,
83+
stagger: 0.05,
84+
duration: 0.8,
8685
ease: 'power4.out',
87-
}, 0.5)
88-
.from('.hero-subtitle', {
89-
y: 30,
90-
opacity: 0,
91-
duration: 1,
92-
ease: 'power3.out',
93-
}, '-=0.8')
94-
.from('.hero-cta', {
95-
y: 20,
96-
opacity: 0,
97-
duration: 0.8,
98-
stagger: 0.1,
99-
ease: 'power3.out',
100-
}, '-=0.6')
101-
.from('.hero-scroll-indicator', {
102-
opacity: 0,
103-
duration: 1,
104-
}, '-=0.4')
86+
}, 0.1)
10587
}
10688

107-
// ── Parallax Scroll Effects ──
108-
// Mountains (Background) - Moves slowest (0.2x visual speed relative to scroll)
109-
gsap.to('.hero-bg-mountains', {
110-
yPercent: 20, // Moves slightly down as we scroll down
111-
ease: 'none',
112-
scrollTrigger: {
113-
trigger: heroRef.current,
114-
start: 'top top',
115-
end: 'bottom top',
116-
scrub: true,
117-
}
118-
})
89+
// Subtitle & Rest (Sequenced with absolute timing for reliability)
90+
// Subtitle & Rest (Sequenced with absolute timing for reliability)
91+
tl.fromTo('.hero-subtitle',
92+
{ y: 20, autoAlpha: 0 },
93+
{ y: 0, autoAlpha: 1, duration: 0.8, ease: 'power3.out' },
94+
0.5
95+
)
96+
97+
tl.fromTo('.hero-cta',
98+
{ y: 20, autoAlpha: 0 },
99+
{ y: 0, autoAlpha: 1, duration: 0.8, stagger: 0.1, ease: 'power3.out' },
100+
0.6
101+
)
102+
103+
tl.fromTo('.hero-scroll-indicator',
104+
{ autoAlpha: 0 },
105+
{ autoAlpha: 1, duration: 1 },
106+
0.9
107+
)
119108

120-
// Tea Gardens (Mid-ground) - Moves medium speed (0.5x)
121-
gsap.to('.hero-bg-midground', {
122-
yPercent: 40, // Moves faster than mountains
123-
ease: 'none',
124-
scrollTrigger: {
125-
trigger: heroRef.current,
126-
start: 'top top',
127-
end: 'bottom top',
128-
scrub: true,
129-
}
130-
})
131-
132-
// Text/Foreground (1x - Natural scroll, but we can add a slight opacity fade)
109+
// ── Parallax Scroll Effects ──
133110
gsap.to('.hero-foreground', {
134-
yPercent: 60, // Parallax text movement
135-
opacity: 0,
136-
ease: 'none',
137111
scrollTrigger: {
138112
trigger: heroRef.current,
139113
start: 'top top',
140-
end: 'bottom top', // Fade out by 60% of viewport
114+
end: 'bottom center', // Fade out halfway through
141115
scrub: true,
142-
}
116+
},
117+
y: -50, // Move up slightly
118+
opacity: 0,
119+
ease: 'none'
143120
})
144121

145122
// ── Magic section — stagger reveal ──
@@ -238,14 +215,16 @@ export default function Home() {
238215
}, { scope: heroRef, dependencies: [] })
239216

240217
return (
241-
<main className="relative overflow-hidden cursor-none"> {/* Hide default cursor here too for safety */}
242-
<CustomCursor />
218+
<main className="relative overflow-hidden">
219+
243220

244221
{/* ═══════════ HERO ═══════════ */}
245-
<section ref={heroRef} className="relative h-screen w-full flex items-center justify-center overflow-hidden bg-black">
222+
<section ref={heroRef} className="relative h-[100dvh] w-full flex items-center justify-center overflow-hidden">
223+
{/* Layer 0: Deep Black Background (Fallback) */}
224+
<div className="absolute inset-0 bg-black -z-50" />
246225

247-
{/* Layer 1: Background Mountains (Moves slow) */}
248-
<div className="hero-bg-mountains absolute inset-0 -z-30 h-[120%] w-full top-0">
226+
{/* Layer 1: Background Mountains (Single Hero Image) */}
227+
<div className="hero-bg-mountains absolute inset-0 z-0 h-full w-full top-0">
249228
<Image
250229
src={getAssetPath("/images/darjeeling_hero_bg_1770289408859.webp")}
251230
alt="Himalayan Peaks"
@@ -254,21 +233,8 @@ export default function Home() {
254233
priority
255234
quality={90}
256235
/>
257-
{/* Atmospheric Haze */}
258-
<div className="absolute inset-0 bg-gradient-to-b from-slate-900/30 via-transparent to-slate-900/80" />
259-
</div>
260-
261-
{/* Layer 2: Midground Tea Gardens (Moves medium) */}
262-
<div className="hero-bg-midground absolute inset-0 -z-20 h-[120%] w-full top-[20%]">
263-
<Image
264-
src={getAssetPath("/images/darjeeling_tea_garden.webp")}
265-
alt="Tea Gardens"
266-
fill
267-
className="object-cover object-top opacity-90"
268-
priority
269-
/>
270-
{/* Blend Gradient */}
271-
<div className="absolute inset-0 bg-gradient-to-t from-black via-black/20 to-transparent" />
236+
{/* Atmospheric Haze - Enhanced for contrast */}
237+
<div className="absolute inset-0 bg-gradient-to-b from-black/60 via-black/40 to-black/80" />
272238
</div>
273239

274240
{/* Layer 3: Foreground Text */}
@@ -295,14 +261,14 @@ export default function Home() {
295261
onClick={() => {
296262
document.getElementById('routes')?.scrollIntoView({ behavior: 'smooth' });
297263
}}
298-
className="hero-cta group inline-flex items-center gap-3 px-10 py-5 bg-white text-primary text-sm tracking-[0.2em] uppercase font-bold rounded-full hover:bg-white/90 hover:scale-105 hover:shadow-[0_0_40px_rgba(255,255,255,0.3)] transition-all duration-500"
264+
className="hero-cta will-change-transform group inline-flex items-center gap-3 px-10 py-5 bg-white text-primary text-sm tracking-[0.2em] uppercase font-bold rounded-full hover:bg-white/90 hover:scale-105 transition-all duration-500"
299265
>
300266
Start Exploring
301267
<ArrowRight className="w-4 h-4 transition-transform group-hover:translate-x-1" />
302268
</button>
303269
<Link
304270
href="/signup"
305-
className="hero-cta inline-flex items-center gap-3 px-10 py-5 bg-white/10 text-white text-sm tracking-[0.2em] uppercase font-semibold rounded-full hover:bg-white/20 backdrop-blur-md border border-white/20 hover:border-white/40 transition-all duration-500"
271+
className="hero-cta will-change-transform inline-flex items-center gap-3 px-10 py-5 bg-white/10 text-white text-sm tracking-[0.2em] uppercase font-semibold rounded-full hover:bg-white/20 backdrop-blur-md border border-white/20 hover:border-white/40 transition-all duration-500"
306272
>
307273
For Agencies
308274
</Link>

src/components/LayoutClient.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@ export function LayoutClient({ children }: { children: React.ReactNode }) {
1010
const pathname = usePathname();
1111
const isAdminRoute = pathname?.startsWith("/admin");
1212
return (
13-
<body className="font-sans bg-background text-foreground antialiased min-h-screen flex flex-col noise-bg px-0">
13+
<body className="font-sans bg-background text-foreground antialiased min-h-[100dvh] flex flex-col noise-bg px-0">
1414
<GitHubPagesRedirect />
1515
{/* <CustomCursor /> */}
1616
{!isAdminRoute && <Navbar />}
1717
{/* <SmoothScroll> */}
1818

19-
{/* Main Content - Relative & Z-10 to cover footer */}
20-
<main className="relative z-10 bg-background shadow-2xl mb-[80vh] md:mb-[60vh] lg:mb-[50vh]">
19+
{/* Main Content */}
20+
<div className="flex-1 bg-background relative flex flex-col">
2121
{children}
22-
</main>
22+
</div>
2323

24-
{/* Sticky Reveal Footer - Fixed & Z-0 */}
25-
{!isAdminRoute && (
26-
<div className="fixed bottom-0 left-0 w-full z-0 h-[80vh] md:h-[60vh] lg:h-[50vh] flex flex-col justify-end">
27-
<Footer variant="ghost" />
28-
</div>
29-
)}
24+
{/* Standard Footer */}
25+
{!isAdminRoute && <Footer variant="ghost" />}
3026
{/* </SmoothScroll> */}
3127
</body>
3228
);

src/components/RouteClient.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -285,24 +285,6 @@ export function RouteClient({ slug, tid: initialTid }: RouteClientProps) {
285285

286286
const filtered = agencies.filter(Boolean) as Agency[];
287287

288-
// MOCK AGENCY FOR DEMONSTRATION - REMOVE BEFORE PROD
289-
if (filtered.length === 0) {
290-
filtered.push({
291-
id: 'mock-agency-1',
292-
name: 'Himalayan Explorers',
293-
contactNo: '+91 98765 43210',
294-
email: 'contact@himalayan.com',
295-
website: 'https://himalayan.com',
296-
address: 'Sevoke Road, Siliguri, WB',
297-
isVerified: true,
298-
whatsapp: '+91 98765 43210',
299-
logoUrl: 'https://ui-avatars.com/api/?name=Himalayan+Explorers&background=random&color=fff&size=200',
300-
status: 'approved',
301-
trialStart: new Date(),
302-
trialExpiry: new Date(Date.now() + 86400000)
303-
});
304-
}
305-
306288
setAgencyList(filtered);
307289

308290
// If we have an active agency from URL, select it

src/components/layout/Navbar.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export function Navbar() {
6262
>
6363
PathSathi
6464
</span>
65-
{/* Shimmer overlay */}
66-
<span className="absolute inset-0 bg-gradient-to-r from-transparent via-white/80 to-transparent -translate-x-[150%] group-hover:animate-shimmer z-20 mix-blend-overlay pointer-events-none" />
65+
6766
</Link>
6867

6968
{/* Desktop Navigation */}

0 commit comments

Comments
 (0)