|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { useEffect, useRef } from "react"; |
|
|
|
|
import { gsap } from "gsap"; |
|
|
|
|
import { ScrollTrigger } from "gsap/ScrollTrigger"; |
|
|
|
|
import uamImg from "../../../public/images/uam-silver.png"; |
|
|
|
|
gsap.registerPlugin(ScrollTrigger); |
|
|
|
|
|
|
|
|
|
function MainAirspaceTransition() { |
|
|
|
|
@ -9,22 +10,15 @@ function MainAirspaceTransition() {
|
|
|
|
|
const rightRef = useRef(null); |
|
|
|
|
const lineRef = useRef([]); |
|
|
|
|
const dotRef = useRef(null); |
|
|
|
|
const uamImageRef = useRef(null); |
|
|
|
|
const uamImageRef = useRef(null); // ← 추가 |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
const ctx = gsap.context(() => { |
|
|
|
|
gsap.set(rightRef.current, { xPercent: 100 }); |
|
|
|
|
gsap.set(lineRef.current, { scaleX: 0, transformOrigin: "left center" }); |
|
|
|
|
gsap.set(dotRef.current, { |
|
|
|
|
x: -320, |
|
|
|
|
opacity: 0, |
|
|
|
|
scale: 1, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
gsap.set(".airspace-uam-content", { |
|
|
|
|
opacity: 0, |
|
|
|
|
y: 36, |
|
|
|
|
}); |
|
|
|
|
gsap.set(dotRef.current, { x: -320, opacity: 0, scale: 1 }); |
|
|
|
|
gsap.set(".airspace-uam-content", { opacity: 0, y: 36 }); |
|
|
|
|
gsap.set(uamImageRef.current, { opacity: 0 }); // ← 추가 |
|
|
|
|
|
|
|
|
|
const tl = gsap.timeline({ |
|
|
|
|
scrollTrigger: { |
|
|
|
|
@ -71,39 +65,21 @@ function MainAirspaceTransition() {
|
|
|
|
|
"<", |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// /* 마지막: 동그라미 줌 */ |
|
|
|
|
// tl.to(dotRef.current, { |
|
|
|
|
// scale: 46, |
|
|
|
|
// duration: 1.2, |
|
|
|
|
// ease: "power2.inOut", |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
// tl.to( |
|
|
|
|
// ".airspace-uam-content", |
|
|
|
|
// { |
|
|
|
|
// opacity: 1, |
|
|
|
|
// y: 0, |
|
|
|
|
// duration: 0.8, |
|
|
|
|
// ease: "power2.out", |
|
|
|
|
// }, |
|
|
|
|
// "-=0.35" |
|
|
|
|
// ); |
|
|
|
|
|
|
|
|
|
/* 마지막: 내부 점 제거 */ |
|
|
|
|
tl.call(() => { |
|
|
|
|
dotRef.current?.classList.add("is-zooming"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
/* 마지막: 동그라미 줌 */ |
|
|
|
|
tl.to(dotRef.current, { |
|
|
|
|
x: 0, |
|
|
|
|
y: 0, |
|
|
|
|
scale: 72, |
|
|
|
|
scale: 52, |
|
|
|
|
duration: 1.2, |
|
|
|
|
ease: "power2.inOut", |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// airspace-uam-content + UAM 이미지 동시 등장 ← 수정 |
|
|
|
|
tl.to( |
|
|
|
|
".airspace-uam-content", |
|
|
|
|
[".airspace-uam-content", uamImageRef.current], |
|
|
|
|
{ |
|
|
|
|
opacity: 1, |
|
|
|
|
y: 0, |
|
|
|
|
@ -141,11 +117,13 @@ function MainAirspaceTransition() {
|
|
|
|
|
))} |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="airspace-moving-dot" ref={dotRef} /> |
|
|
|
|
|
|
|
|
|
<div className="airspace-uam-vehicle" ref={uamImageRef}> |
|
|
|
|
<img src="/images/uam-silver.png" alt="" /> |
|
|
|
|
{/* 동그라미 + UAM 이미지 */} |
|
|
|
|
<div className="airspace-moving-dot" ref={dotRef}> |
|
|
|
|
<div className="airspace-dot-image" ref={uamImageRef}> |
|
|
|
|
<img src={uamImg} alt="UAM Aircraft" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div className="airspace-uam-content"> |
|
|
|
|
<p>UAM NETWORK</p> |
|
|
|
|
<h2>Urban Air Mobility</h2> |
|
|
|
|
|