4 changed files with 129 additions and 2 deletions
@ -0,0 +1,95 @@
|
||||
import { useEffect, useRef } from "react"; |
||||
import { gsap } from "gsap"; |
||||
import { ScrollTrigger } from "gsap/ScrollTrigger"; |
||||
|
||||
gsap.registerPlugin(ScrollTrigger); |
||||
|
||||
function MainSolution() { |
||||
const sectionRef = useRef(null); |
||||
const headRef = useRef(null); |
||||
const cardsRef = useRef([]); |
||||
|
||||
useEffect(() => { |
||||
const ctx = gsap.context(() => { |
||||
gsap.set(headRef.current, { opacity: 0, y: 42 }); |
||||
gsap.set(cardsRef.current, { opacity: 0, y: 64, scale: 0.96 }); |
||||
|
||||
gsap |
||||
.timeline({ |
||||
scrollTrigger: { |
||||
trigger: sectionRef.current, |
||||
start: "top 72%", |
||||
end: "top 28%", |
||||
scrub: 1, |
||||
}, |
||||
}) |
||||
.to(headRef.current, { |
||||
opacity: 1, |
||||
y: 0, |
||||
duration: 0.8, |
||||
ease: "power2.out", |
||||
}) |
||||
.to( |
||||
cardsRef.current, |
||||
{ |
||||
opacity: 1, |
||||
y: 0, |
||||
scale: 1, |
||||
stagger: 0.12, |
||||
duration: 0.9, |
||||
ease: "power2.out", |
||||
}, |
||||
"-=0.35", |
||||
); |
||||
|
||||
gsap.to(".main-solution-bg-circle", { |
||||
y: 120, |
||||
scale: 1.08, |
||||
ease: "none", |
||||
scrollTrigger: { |
||||
trigger: sectionRef.current, |
||||
start: "top bottom", |
||||
end: "bottom top", |
||||
scrub: 1, |
||||
}, |
||||
}); |
||||
}, sectionRef); |
||||
|
||||
return () => ctx.revert(); |
||||
}, []); |
||||
|
||||
return ( |
||||
<section className="main-solution-section" ref={sectionRef}> |
||||
<div className="main-solution-bg-circle" /> |
||||
|
||||
<div className="main-solution-inner"> |
||||
<div className="main-solution-head" ref={headRef}> |
||||
<p className="main-solution-eyebrow">PAL SOLUTION</p> |
||||
<h2 className="main-solution-title"> |
||||
미래 항공 |
||||
<br /> |
||||
통합 운영 시스템 |
||||
</h2> |
||||
<p className="main-solution-desc"> |
||||
드론과 도심항공교통의 운항 흐름을 하나의 플랫폼 안에서 연결하고, |
||||
실시간 관제와 데이터 기반 운영 환경을 제공합니다. |
||||
</p> |
||||
</div> |
||||
|
||||
<div className="main-solution-grid"> |
||||
{[0, 1, 2, 3].map((_, index) => ( |
||||
<article |
||||
className="main-solution-card" |
||||
key={index} |
||||
ref={(el) => { |
||||
cardsRef.current[index] = el; |
||||
}} |
||||
/> |
||||
))} |
||||
</div> |
||||
</div> |
||||
</section> |
||||
); |
||||
} |
||||
|
||||
export default MainSolution; |
||||
Loading…
Reference in new issue