Skip to content

Commit 993820d

Browse files
authored
Design/main#11 (#138)
* [style] 배경 * [design] 랜딩페이지 3d모델 * 3d 렌더링 * 로고,텍스트 추가 * 패키지제이슨 * 메인작업 * 카메라액션 취소 * 별 애니메이션 취소 * 대문자
1 parent 1dbeb90 commit 993820d

26 files changed

+554
-322
lines changed

public/1Stars.png

-28.5 KB
Binary file not shown.

public/1Stars.webp

13.5 KB
Loading

public/2Stars.png

-30.8 KB
Binary file not shown.

public/2Stars.webp

14.5 KB
Loading

public/CocktailDrop_4x.webp

666 KB
Loading

src/app/page.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import Landing from '@/domains/shared/components/3d/Landing';
2-
3-
import MainSlide from '@/domains/main/components/mainSlide/components/MainSlide';
1+
import FinalLanding from '@/domains/main/components/FinalLanding';
42

53
export default function Home() {
64
return (
75
<div className="page-layout max-w-full">
8-
<Landing />
9-
<MainSlide />
6+
<FinalLanding />
107
</div>
118
);
129
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
'use client';
2+
3+
import Image from 'next/image';
4+
import Cocktailcup from '../../../../public/CocktailDrop_4x.webp';
5+
import { useLayoutEffect, useRef } from 'react';
6+
import gsap from 'gsap';
7+
import { ScrollTrigger } from 'gsap/all';
8+
9+
gsap.registerPlugin(ScrollTrigger);
10+
11+
function CocktailDrop() {
12+
const containerRef = useRef<HTMLDivElement>(null);
13+
const logoRef = useRef<HTMLDivElement>(null);
14+
const line1Ref = useRef<HTMLDivElement>(null);
15+
const line2Ref = useRef<HTMLDivElement>(null);
16+
17+
useLayoutEffect(() => {
18+
const ctx = gsap.context(() => {
19+
// 양쪽 대각선 줄 들어오기 (line1, line2)
20+
gsap.fromTo(
21+
[line1Ref.current, line2Ref.current],
22+
{
23+
x: (i) => (i === 0 ? '-100%' : '100%'),
24+
opacity: 0,
25+
},
26+
{
27+
x: '0%',
28+
opacity: 1,
29+
ease: 'power4.out',
30+
duration: 1.2,
31+
stagger: 0.2,
32+
scrollTrigger: {
33+
trigger: containerRef.current,
34+
// markers: true, // ✅ 디버
35+
start: 'top 95%',
36+
toggleActions: 'restart none none none',
37+
once: false,
38+
},
39+
}
40+
);
41+
42+
// 로고 위에서 아래로 자연스럽게 등장
43+
gsap.fromTo(
44+
logoRef.current,
45+
{ y: -300, opacity: 0 },
46+
{
47+
y: -40,
48+
opacity: 1,
49+
duration: 3,
50+
ease: 'power3.out',
51+
scrollTrigger: {
52+
trigger: containerRef.current,
53+
// markers: true, // ✅ 디버
54+
start: 'top 90%',
55+
toggleActions: 'restart none none none',
56+
once: false,
57+
},
58+
}
59+
);
60+
ScrollTrigger.refresh();
61+
}, containerRef);
62+
63+
return () => ctx.revert();
64+
}, [containerRef]);
65+
66+
return (
67+
<div
68+
ref={containerRef}
69+
className="relative w-full min-h-[110vh] flex flex-col justify-center items-center mt-10"
70+
id="scroll-fixed"
71+
>
72+
{/* 대각선 줄 1 */}
73+
<div
74+
ref={line1Ref}
75+
className="absolute top-[80px] left-[-50%] w-[200%] h-[40px] bg-secondary/80 rotate-[8deg] z-10"
76+
/>
77+
{/* 대각선 줄 2 */}
78+
<div
79+
ref={line2Ref}
80+
className="absolute top-[140px] left-[-50%] w-[200%] h-[40px] bg-secondary rotate-[8deg] z-10"
81+
/>
82+
83+
{/* 로고 */}
84+
<div ref={logoRef} className="absolute z-20">
85+
<Image
86+
src="/logo.svg"
87+
alt="로고 이미지"
88+
width={600}
89+
height={600}
90+
className="rotate-[-9deg]"
91+
/>
92+
</div>
93+
94+
<div className="w-full h-90"></div>
95+
96+
{/* 컵 이미지 */}
97+
<div className="z-10">
98+
<Image src={Cocktailcup} alt="칵테일 컵" width={800} height={800} priority />
99+
</div>
100+
</div>
101+
);
102+
}
103+
104+
export default CocktailDrop;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Image from 'next/image';
2+
3+
function HomeLogo({ isDesktop }: { isDesktop: boolean }) {
4+
return (
5+
<div
6+
className="z-5 absolute md:top-8 md:left-10 md:translate-none top-13 left-1/2 -translate-x-1/2"
7+
style={{ width: !isDesktop ? 400 : 700, height: !isDesktop ? 70 : 240 }}
8+
>
9+
<Image src={'/logo.svg'} alt="로고 이미지" fill priority className="object-contain" />
10+
</div>
11+
);
12+
}
13+
14+
export default HomeLogo;

src/domains/shared/components/3d/HomeModel.tsx renamed to src/domains/main/components/3d/HomeModel.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
import { Environment, OrbitControls, useGLTF } from '@react-three/drei';
44
import { Canvas, useFrame, useThree } from '@react-three/fiber';
55
import { Bloom, EffectComposer } from '@react-three/postprocessing';
6-
import { useEffect, useRef, useState } from 'react';
6+
import { useEffect, useRef } from 'react';
77
import * as THREE from 'three';
88

9-
function Model({ onLoaded }: { onLoaded: () => void }) {
10-
const { scene } = useGLTF('/3d/model/scene.gltf');
11-
const [scale, setScale] = useState(13);
9+
interface Props {
10+
onLoaded: () => void;
11+
}
1212

13-
useEffect(() => {
14-
const isMobile = window.innerWidth < 768; // 모바일 기준 너비
15-
setScale(isMobile ? 3.8 : 11.5); // 모바일이면 작게
16-
}, []);
13+
function Model({ onLoaded }: Props) {
14+
const { scene } = useGLTF('/3d/model/scene.gltf');
1715

1816
useEffect(() => {
1917
if (scene) {
@@ -41,7 +39,7 @@ function Model({ onLoaded }: { onLoaded: () => void }) {
4139
}
4240
});
4341

44-
return <primitive object={scene} scale={scale} />;
42+
return <primitive object={scene} scale={18} position={[0, -1.2, 0]} />;
4543
}
4644

4745
function CameraAnimation() {
@@ -61,16 +59,20 @@ function CameraAnimation() {
6159
return null;
6260
}
6361

64-
function HomeModel({ onLoaded }: { onLoaded: () => void }) {
62+
function HomeModel({ onLoaded }: Props) {
6563
return (
66-
<Canvas className="z-10 w-full" camera={{ position: [5, 20, 10], fov: 30 }} dpr={[1, 1.5]}>
67-
<ambientLight intensity={0.5} />
64+
<Canvas
65+
className="z-10 w-full pointer-none"
66+
camera={{ position: [10, 40, 9], fov: 26 }}
67+
dpr={[1, 1.5]}
68+
>
69+
<ambientLight intensity={1} />
6870
<pointLight position={[10, 30, 40]} intensity={1} />
6971
<spotLight position={[0, 10, 10]} angle={0.2} penumbra={1} intensity={15} castShadow />
70-
<directionalLight intensity={6} color={0xffffff} position={[10, 40, 100]} />
72+
<directionalLight intensity={8} color={0xffffff} position={[10, 40, 100]} />
7173
<Environment files={`/hdri/footprint_court.hdr`} background={false} />
7274
<Model onLoaded={onLoaded} />
73-
<CameraAnimation />
75+
{/* <CameraAnimation /> */}
7476
<OrbitControls
7577
enablePan={false}
7678
enableZoom={false}

0 commit comments

Comments
 (0)