@@ -5,10 +5,15 @@ import Cocktailcup from '../../../../public/CocktailDrop.webp';
55import { useLayoutEffect , useRef } from 'react' ;
66import gsap from 'gsap' ;
77import { ScrollTrigger } from 'gsap/all' ;
8+ import PassBtn from './PassBtn' ;
89
910gsap . registerPlugin ( ScrollTrigger ) ;
1011
11- function CocktailDrop ( ) {
12+ interface CocktailDropProps {
13+ isDesktop ?: boolean ;
14+ }
15+
16+ function CocktailDrop ( { isDesktop = false } : CocktailDropProps ) {
1217 const containerRef = useRef < HTMLDivElement > ( null ) ;
1318 const logoRef = useRef < HTMLDivElement > ( null ) ;
1419 const line1Ref = useRef < HTMLDivElement > ( null ) ;
@@ -39,12 +44,11 @@ function CocktailDrop() {
3944 ) ;
4045
4146 // 로고 위에서 아래로 자연스럽게 등장
42- const isMobile = window . innerWidth < 768 ;
4347 gsap . fromTo (
4448 logoRef . current ,
4549 { y : - 300 , opacity : 0 } ,
4650 {
47- y : isMobile ? - 140 : - 18 , // 모바일에서는 더 위로
51+ y : ! isDesktop ? - 230 : - 18 , // 데스크톱이 아닐 때 더 위로
4852 opacity : 1 ,
4953 duration : 3 ,
5054 ease : 'power3.out' ,
@@ -60,12 +64,12 @@ function CocktailDrop() {
6064 } , containerRef ) ;
6165
6266 return ( ) => ctx . revert ( ) ;
63- } , [ containerRef ] ) ;
67+ } , [ containerRef , isDesktop ] ) ;
6468
6569 return (
6670 < div
6771 ref = { containerRef }
68- className = "relative w-full md :min-h-[110vh] min-h-[74vh ] flex flex-col md:justify-center justify-end items-center mt-10 overflow-hidden"
72+ className = "relative w-full lg :min-h-[110vh] min-h-[89vh ] flex flex-col md:justify-center justify-end items-center mt-10 overflow-hidden"
6973 id = "scroll-fixed"
7074 >
7175 { /* 대각선 줄 1 */ }
@@ -80,7 +84,7 @@ function CocktailDrop() {
8084 />
8185
8286 { /* 로고 */ }
83- < div ref = { logoRef } className = "absolute z-20 md:w-115 w-65 md:h-90 h-40" >
87+ < div ref = { logoRef } className = "absolute md:w-115 w-85 md:h-90 h-40" >
8488 < Image
8589 src = "/logo.svg"
8690 alt = "로고 이미지"
@@ -94,17 +98,19 @@ function CocktailDrop() {
9498 < div className = "w-full md:h-90 h-30" > </ div >
9599
96100 { /* 컵 이미지 - 모바일에서 바닥에 붙도록 */ }
97- < div className = "z-10 md:relative absolute bottom-0" >
101+ < div className = "md:relative absolute bottom-0" >
98102 < Image
99103 src = { Cocktailcup }
100104 alt = "칵테일 컵"
101105 width = { 900 }
102- height = { 800 }
106+ height = { 700 }
103107 priority
104- style = { { width : 'auto' , height : 'auto' } }
105- className = "md:w-auto md:h-auto w-[300px] h-[300px] object-contain"
108+ className = "md:w-auto md:h-auto w-[500px] h-[400px] object-cover"
106109 />
107110 </ div >
111+ < div className = "absolute md:bottom-35 bottom-20 flex items-center justify-center z-3 w-full" >
112+ < PassBtn />
113+ </ div >
108114 </ div >
109115 ) ;
110116}
0 commit comments