@@ -4,49 +4,19 @@ import { useGSAP } from '@gsap/react';
44import { ScrollTrigger } from 'gsap/ScrollTrigger' ;
55import { ScrollToPlugin } from 'gsap/ScrollToPlugin' ;
66import { ScrollSmoother } from 'gsap/ScrollSmoother' ;
7- import { useEffect , useRef , useState } from 'react' ;
7+ import { useRef } from 'react' ;
88import BeamBackground from '@/components/landing-page/BeamBackground' ;
9- import { Hero , Footer } from '@/components/landing-page' ;
9+ import { Hero } from '@/components/landing-page' ;
1010import HowBoundlessWork from '@/components/landing-page/HowBoundlessWork' ;
1111import WhyBoundless from '@/components/landing-page/WhyBoundless' ;
1212import BackedBy from '@/components/landing-page/BackedBy' ;
1313import NewsLetter from '@/components/landing-page/NewsLetter' ;
1414import 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
1917export 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