diff --git a/src/app/(with-header)/components/BannerSection.tsx b/src/app/(with-header)/components/BannerSection.tsx index 605218d..529ac80 100644 --- a/src/app/(with-header)/components/BannerSection.tsx +++ b/src/app/(with-header)/components/BannerSection.tsx @@ -17,7 +17,7 @@ export default function BannerSection() {
{/* 텍스트 콘텐츠 */} -
+

함께 배우면 즐거운
스트릿 댄스 diff --git a/src/app/(with-header)/components/ExperienceCard.tsx b/src/app/(with-header)/components/ExperienceCard.tsx new file mode 100644 index 0000000..021a1b8 --- /dev/null +++ b/src/app/(with-header)/components/ExperienceCard.tsx @@ -0,0 +1,26 @@ +import Image from 'next/image'; + +export default function ExperienceCard() { + return ( +
+ {/* 배경 이미지 */} + 체험 이미지 + {/* 어두운 오버레이 */} +
+ {/* 텍스트 정보 블록 (카드 하단 위치 고정) */} +
+ {/* 별점 정보 */} + ⭐ 4.9 (293) + {/* 체험명 (줄바꿈 포함, 반응형 크기) */} +

함께 배우면 즐거운
스트릿 댄스

+ {/* 가격 정보 */} +

₩ 38,000 / 인

+
+
+ ); +} diff --git a/src/app/(with-header)/components/PopularExperiences.tsx b/src/app/(with-header)/components/PopularExperiences.tsx new file mode 100644 index 0000000..1441b96 --- /dev/null +++ b/src/app/(with-header)/components/PopularExperiences.tsx @@ -0,0 +1,56 @@ +'use client'; + +import { useRef } from 'react'; +import ExperienceCard from '@/app/(with-header)/components/ExperienceCard'; +import IconArrowRight from '@assets/svg/right-arrow'; +import IconArrowLeft from '@assets/svg/left-arrow'; + +export default function PopularExperiences() { + // 카드 슬라이더를 참조할 DOM ref + const sliderRef = useRef(null); + + // 좌우 버튼 클릭 시 한 장씩 슬라이드 이동 + const scrollByCard = (direction: 'left' | 'right') => { + if (!sliderRef.current) return; + + // 첫 번째 카드 요소를 찾아서 너비 측정 + const card = sliderRef.current.querySelector('.card'); + if (!(card instanceof HTMLElement)) return; + + const cardWidth = card.offsetWidth; // 카드 너비 + const gap = parseInt(getComputedStyle(sliderRef.current).gap) || 0; // gap 값 + const distance = cardWidth + gap; // 한 번에 이동할 거리 + + // 슬라이더 스크롤 이동 (좌/우 방향에 따라) + sliderRef.current.scrollBy({ + left: direction === 'left' ? -distance : distance, + behavior: 'smooth', + }); + }; + + return ( +
+ {/* 섹션 제목 + 좌우 화살표 버튼 */} +
+

🔥 인기 체험

+
+ scrollByCard('left')} className='text-2xl px-3' /> + scrollByCard('right')} className='text-2xl px-3' /> +
+
+ + {/* 가로 슬라이드 카드 리스트 */} +
+ {[...Array(4)].map((_, idx) => ( + // 카드 wrapper: flex-shrink-0으로 크기 고정 + 'card' 클래스로 식별 +
+ +
+ ))} +
+
+ ); +} diff --git a/src/app/(with-header)/components/SearchBar.tsx b/src/app/(with-header)/components/SearchBar.tsx index 1b0cc72..e5f6662 100644 --- a/src/app/(with-header)/components/SearchBar.tsx +++ b/src/app/(with-header)/components/SearchBar.tsx @@ -13,7 +13,7 @@ export default function SearchBar() { }; return ( -
+

diff --git a/src/app/(with-header)/page.tsx b/src/app/(with-header)/page.tsx index 7293bf3..ae80e34 100644 --- a/src/app/(with-header)/page.tsx +++ b/src/app/(with-header)/page.tsx @@ -1,9 +1,11 @@ import BannerSection from '@/app/(with-header)/components/BannerSection'; +import PopularExperiences from '@/app/(with-header)/components/PopularExperiences'; export default function HomePage() { return (
+
); } \ No newline at end of file diff --git a/src/app/globals.css b/src/app/globals.css index 985b284..571278e 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -131,3 +131,11 @@ --spacing: 0.0625rem; } + +.no-scrollbar::-webkit-scrollbar { + display: none; +} +.no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; +} \ No newline at end of file