Skip to content

Commit b54fe15

Browse files
committed
메인 수정
1 parent a115156 commit b54fe15

File tree

6 files changed

+49
-19
lines changed

6 files changed

+49
-19
lines changed

src/domains/main/cocktailDrop/CocktailDrop.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ import Cocktailcup from '../../../../public/CocktailDrop.webp';
55
import { useLayoutEffect, useRef } from 'react';
66
import gsap from 'gsap';
77
import { ScrollTrigger } from 'gsap/all';
8+
import PassBtn from './PassBtn';
89

910
gsap.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
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { useRouter } from 'next/navigation';
2+
3+
function PassBtn() {
4+
const router = useRouter();
5+
const handleClick = () => {
6+
router.push('/recommend');
7+
};
8+
return (
9+
<button
10+
onClick={handleClick}
11+
className="w-[90%] md:w-120 py-5 md:px-20 px-5 md:text-2xl text-lg rounded-xl flex items-center justify-center bg-tertiary/70"
12+
>
13+
<span className="text-primary font-serif whitespace-nowrap">
14+
칵테일 취향추천 <span className="text-secondary font-serif">바로가기</span>
15+
</span>
16+
</button>
17+
);
18+
}
19+
20+
export default PassBtn;

src/domains/main/components/3d/ModelImage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ function ModelImage({ onLoaded }: Props) {
1111
onLoaded();
1212
});
1313
return (
14-
<div className="w-full flex justify-center items-center absolute bottom-20 left-1/2 -translate-x-1/2">
14+
<div className="w-full flex justify-center items-center absolute bottom-13 left-1/2 -translate-x-1/2">
1515
<div className="rounded-tr-4xl rounded-tl-4xl overflow-hidden">
1616
<Image
1717
src={MobileCocktailDrop}
1818
alt="모바일 칵테일 드랍"
19-
width={280}
20-
height={360}
21-
style={{ width: 'auto', height: 'auto' }}
22-
className="object-cover"
19+
width={260}
20+
height={290}
21+
priority
22+
className="object-cover w-[300px] h-[390px]"
2323
/>
2424
</div>
2525
</div>

src/domains/main/components/3d/Scroll.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Scroll({ isDesktop }: { isDesktop: boolean }) {
1212
height: 60,
1313
};
1414
return (
15-
<div className="absolute bottom-18 left-1/2 -translate-x-1/2 rounded-full bg-secondary/10 z-11 md:w-[60px] md:h-[60px] w-[45px] h-[45px]">
15+
<div className="absolute bottom-18 left-1/2 -translate-x-1/2 rounded-full md:bg-secondary/10 bg-primary/30 z-11 md:w-[60px] md:h-[60px] w-[45px] h-[45px]">
1616
<div className="z-11">
1717
<Lottie animationData={scroll} style={style} aria-hidden loop={true} />
1818
</div>

src/domains/main/components/FinalLanding.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ function FinalLanding() {
1313
const smootherRef = useRef<ScrollSmoother | null>(null);
1414

1515
const [isDesktop, setIsDesktop] = useState(false);
16+
const [hasMounted, setHasMounted] = useState(false);
1617

1718
useEffect(() => {
1819
const checkViewport = () => {
1920
setIsDesktop(window.innerWidth >= 1024);
2021
};
2122

2223
checkViewport();
24+
setHasMounted(true);
2325

2426
window.addEventListener('resize', checkViewport);
2527

@@ -58,6 +60,8 @@ function FinalLanding() {
5860
};
5961
}, [isDesktop]);
6062

63+
if (!hasMounted) return null;
64+
6165
return (
6266
<div className="overflow-x-hidden">
6367
<StarMain />
@@ -69,7 +73,7 @@ function FinalLanding() {
6973
{!isLoading && (
7074
<>
7175
<MainSlide isDesktop={isDesktop} />
72-
<CocktailDrop />
76+
<CocktailDrop isDesktop={isDesktop} />
7377
</>
7478
)}
7579
</div>
@@ -81,7 +85,7 @@ function FinalLanding() {
8185
{!isLoading && (
8286
<>
8387
<MainSlide isDesktop={isDesktop} />
84-
<CocktailDrop />
88+
<CocktailDrop isDesktop={isDesktop} />
8589
</>
8690
)}
8791
</div>

src/domains/main/components/mainSlide/components/MainSlide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function MainSlide({ isDesktop }: { isDesktop: boolean }) {
127127
<MobileSlide key="mobile" />
128128
) : (
129129
<div ref={initialRoot} className="w-full overflow-hidden">
130-
<section key="desktop" ref={root} className="w-full stage h-screen" id="scroll-fixed">
130+
<section key="desktop" ref={root} className="w-full stage h-screen " id="scroll-fixed">
131131
<div className="stage relative w-full h-full overflow-hidden bg-secondary">
132132
<div className="panel absolute inset-0 overflow-hidden">
133133
<MainSlideIntro />

0 commit comments

Comments
 (0)