Skip to content

Commit 4fd3270

Browse files
committed
Done
1 parent 1722da3 commit 4fd3270

File tree

1 file changed

+6
-49
lines changed

1 file changed

+6
-49
lines changed

src/pages/Home.jsx

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import React, { useEffect, useRef } from 'react'
2-
import { gsap } from 'gsap'
3-
import { ScrollTrigger } from 'gsap/ScrollTrigger'
1+
import React from 'react'
42

53
// Import sections
64
import WhyUs from '../components/WhyUS/WhyUs'
@@ -9,57 +7,16 @@ import Faq from '../components/FAQ/Faq'
97
import HeroSection from '../components/Hero/HeroSection'
108
import ComparisonBetweenAlgorithm from '../components/Comparison/ComparisonBetweenAlgorithm'
119

12-
gsap.registerPlugin(ScrollTrigger)
1310

1411
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-
}, [])
4512

4613
return (
4714
<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 />
6320
</div>
6421
)
6522
}

0 commit comments

Comments
 (0)