1
- import React , { useEffect , useRef } from 'react'
2
- import { gsap } from 'gsap'
3
- import { ScrollTrigger } from 'gsap/ScrollTrigger'
1
+ import React from 'react'
4
2
5
3
// Import sections
6
4
import WhyUs from '../components/WhyUS/WhyUs'
@@ -9,57 +7,16 @@ import Faq from '../components/FAQ/Faq'
9
7
import HeroSection from '../components/Hero/HeroSection'
10
8
import ComparisonBetweenAlgorithm from '../components/Comparison/ComparisonBetweenAlgorithm'
11
9
12
- gsap . registerPlugin ( ScrollTrigger )
13
10
14
11
const Home = ( ) => {
15
- const heroRef = useRef ( )
16
- const whyUsRef = useRef ( )
17
- const cardRef = useRef ( )
18
- const compareRef = useRef ( )
19
- const faqRef = useRef ( )
20
-
21
- useEffect ( ( ) => {
22
- const animateSection = ( ref , direction = 50 ) => {
23
- gsap . fromTo (
24
- ref . current ,
25
- { y : direction , opacity : 0 } ,
26
- {
27
- y : 0 ,
28
- opacity : 1 ,
29
- duration : 1 ,
30
- ease : 'power3.out' ,
31
- scrollTrigger : {
32
- trigger : ref . current ,
33
- start : 'top 80%' ,
34
- } ,
35
- }
36
- )
37
- }
38
-
39
- animateSection ( heroRef , 100 )
40
- animateSection ( whyUsRef , 50 )
41
- animateSection ( cardRef , 50 )
42
- animateSection ( compareRef , 50 )
43
- animateSection ( faqRef , 50 )
44
- } , [ ] )
45
12
46
13
return (
47
14
< div className = "flex items-center justify-center w-full min-h-screen gap-32 flex-col" >
48
- < div ref = { heroRef } >
49
- < HeroSection />
50
- </ div >
51
- < div ref = { whyUsRef } >
52
- < WhyUs />
53
- </ div >
54
- < div ref = { cardRef } >
55
- < SortingAlgorithmCard />
56
- </ div >
57
- < div ref = { compareRef } >
58
- < ComparisonBetweenAlgorithm />
59
- </ div >
60
- < div ref = { faqRef } >
61
- < Faq />
62
- </ div >
15
+ < HeroSection />
16
+ < WhyUs />
17
+ < SortingAlgorithmCard />
18
+ < ComparisonBetweenAlgorithm />
19
+ < Faq />
63
20
</ div >
64
21
)
65
22
}
0 commit comments