Skip to content

Commit ddee823

Browse files
committed
refactor: streamline landing page components and enhance accessibility
- Remove unnecessary state and effects from LandingPage component. - Simplify the BackedBy component by integrating testimonials and improving image loading handling. - Update Footer component to utilize social links from config and enhance accessibility features. - Refactor Hero component to improve animation setup and accessibility attributes. - Introduce LooperSVG component for enhanced visual effects in the Hero section. - Update WhyBoundless and BlogSection components for better structure and loading states. - Ensure all components are responsive and maintain consistent styling across the landing page.
1 parent d3f4e3a commit ddee823

9 files changed

Lines changed: 1866 additions & 510 deletions

File tree

app/(landing)/page.tsx

Lines changed: 3 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,19 @@ import { useGSAP } from '@gsap/react';
44
import { ScrollTrigger } from 'gsap/ScrollTrigger';
55
import { ScrollToPlugin } from 'gsap/ScrollToPlugin';
66
import { ScrollSmoother } from 'gsap/ScrollSmoother';
7-
import { useEffect, useRef, useState } from 'react';
7+
import { useRef } from 'react';
88
import BeamBackground from '@/components/landing-page/BeamBackground';
9-
import { Hero, Footer } from '@/components/landing-page';
9+
import { Hero } from '@/components/landing-page';
1010
import HowBoundlessWork from '@/components/landing-page/HowBoundlessWork';
1111
import WhyBoundless from '@/components/landing-page/WhyBoundless';
1212
import BackedBy from '@/components/landing-page/BackedBy';
1313
import NewsLetter from '@/components/landing-page/NewsLetter';
1414
import BlogSection from '@/components/landing-page/blog/BlogSection';
15-
import { useRouter } from 'next/navigation';
16-
import { useIsMobile } from '@/hooks/use-mobile';
17-
import LoadingSpinner from '@/components/LoadingSpinner';
15+
import { Footer } from '@/components/landing-page/footer';
1816

1917
export default function LandingPage() {
2018
const containerRef = useRef<HTMLDivElement>(null);
2119
const contentRef = useRef<HTMLDivElement>(null);
22-
const router = useRouter();
23-
const isMobile = useIsMobile();
24-
const [hasRedirected, setHasRedirected] = useState(false);
25-
26-
useEffect(() => {
27-
const delay = isMobile ? 1000 : 500;
28-
29-
const redirectTimer = setTimeout(() => {
30-
if (!hasRedirected) {
31-
setHasRedirected(true);
32-
router.push('/waitlist');
33-
}
34-
}, delay);
35-
36-
return () => clearTimeout(redirectTimer);
37-
}, [router, isMobile, hasRedirected]);
38-
39-
useEffect(() => {
40-
if (hasRedirected) {
41-
const fallbackTimer = setTimeout(() => {
42-
if (window.location.pathname === '/') {
43-
window.location.href = '/waitlist';
44-
}
45-
}, 2000);
46-
47-
return () => clearTimeout(fallbackTimer);
48-
}
49-
}, [hasRedirected]);
5020

5121
gsap.registerPlugin(ScrollTrigger, ScrollSmoother, ScrollToPlugin);
5222

@@ -59,72 +29,10 @@ export default function LandingPage() {
5929
smoothTouch: 0.1,
6030
effects: true,
6131
});
62-
63-
ScrollTrigger.create({
64-
trigger: '#hero',
65-
start: 'top top',
66-
endTrigger: '#how-boundless-work',
67-
end: 'top top',
68-
pin: true,
69-
scrub: 1,
70-
snap: {
71-
snapTo: value => {
72-
return value < 0.5 ? 0 : 1;
73-
},
74-
duration: { min: 0.2, max: 1 },
75-
delay: 0.1,
76-
ease: 'power1.inOut',
77-
},
78-
});
79-
const handleWheel = (e: WheelEvent) => {
80-
const hero = document.getElementById('hero');
81-
const how = document.getElementById('how-boundless-work');
82-
if (!hero || !how) return;
83-
84-
const heroRect = hero.getBoundingClientRect();
85-
if (heroRect.bottom - 10 <= window.innerHeight && e.deltaY > 0) {
86-
e.preventDefault();
87-
gsap.to(window, {
88-
duration: 0.8,
89-
scrollTo: { y: how, offsetY: 0 },
90-
ease: 'power2.inOut',
91-
});
92-
}
93-
};
94-
95-
setTimeout(() => {
96-
const hero = document.getElementById('hero');
97-
if (hero) {
98-
hero.addEventListener('wheel', handleWheel, { passive: false });
99-
}
100-
}, 0);
101-
102-
ScrollTrigger.addEventListener('refreshInit', () => {
103-
const hero = document.getElementById('hero');
104-
if (hero) {
105-
hero.removeEventListener('wheel', handleWheel);
106-
hero.addEventListener('wheel', handleWheel, { passive: false });
107-
}
108-
});
109-
110-
return () => {
111-
ScrollTrigger.getAll().forEach(trigger => trigger.kill());
112-
};
11332
},
11433
{ scope: containerRef }
11534
);
11635

117-
if (hasRedirected) {
118-
return (
119-
<div className='flex min-h-screen items-center justify-center bg-black'>
120-
<div className='text-center'>
121-
<LoadingSpinner />
122-
<p className='text-lg text-white'>Redirecting to waitlist...</p>
123-
</div>
124-
</div>
125-
);
126-
}
127-
12836
return (
12937
<div ref={containerRef} className='relative overflow-hidden'>
13038
<BeamBackground />

0 commit comments

Comments
 (0)