diff --git a/src/components/HomePage/Contents.tsx b/src/components/HomePage/LookAround/Contents.tsx similarity index 88% rename from src/components/HomePage/Contents.tsx rename to src/components/HomePage/LookAround/Contents.tsx index 56cc1dc..defc673 100644 --- a/src/components/HomePage/Contents.tsx +++ b/src/components/HomePage/LookAround/Contents.tsx @@ -1,6 +1,6 @@ import { Grid, GridItem } from '@chakra-ui/react'; -import { ContentsInfo } from '@/components/HomePage/ContentsInfo'; -import { TestersBox } from './TestersBox'; +import { ContentsInfo } from '@/components/HomePage/LookAround/ContentsInfo'; +import { TestersBox } from '../TestersBox'; export const Contents = () => { return ( diff --git a/src/components/HomePage/ContentsInfo.tsx b/src/components/HomePage/LookAround/ContentsInfo.tsx similarity index 78% rename from src/components/HomePage/ContentsInfo.tsx rename to src/components/HomePage/LookAround/ContentsInfo.tsx index 8460f5a..9524879 100644 --- a/src/components/HomePage/ContentsInfo.tsx +++ b/src/components/HomePage/LookAround/ContentsInfo.tsx @@ -2,6 +2,7 @@ import { Grid, GridItem, Img } from '@chakra-ui/react'; import styled from '@emotion/styled'; import { useMediaQuery } from 'react-responsive'; import { breakpoints } from '@/styles/variants'; +import { MobileSwiper } from './MobileSwiper'; export const ContentsInfo = () => { const isMobile = useMediaQuery({ query: `(max-width : ${breakpoints.md})` }); @@ -15,11 +16,17 @@ export const ContentsInfo = () => { Logo )} - {cardContents.map((content, index) => ( - - - - ))} + {isMobile ? ( + + ) : ( + <> + {cardContents.map((content, index) => ( + + + + ))} + + )} @@ -62,7 +69,7 @@ const StyledImg = styled(Img)` object-fit: cover; // 이미지가 컨테이너에 맞게 조정되도록 설정 `; -const cardContents = [ +export const cardContents = [ { imageSrc: '/images/composition1.svg', }, diff --git a/src/components/HomePage/LookAround/MobileSwiper.tsx b/src/components/HomePage/LookAround/MobileSwiper.tsx new file mode 100644 index 0000000..26a1b26 --- /dev/null +++ b/src/components/HomePage/LookAround/MobileSwiper.tsx @@ -0,0 +1,53 @@ +import React from 'react'; +import { Swiper, SwiperSlide } from 'swiper/react'; +import styled from '@emotion/styled'; +import { Pagination, Autoplay, Navigation } from 'swiper/modules'; + +import 'swiper/css'; +import 'swiper/css/pagination'; +import 'swiper/css/autoplay'; +import 'swiper/css/navigation'; + +export const MobileSwiper = () => { + return ( + <> + + + + 살펴보기 이미지 1 + + + + + 살펴보기 이미지 2 + + + + + 살펴보기 이미지 3 + + + + + ); +}; + +const SwiperWrapper = styled(Swiper)` + width: 100%; + height: 100%; +`; + +const SlideContent = styled.div` + text-align: center; + font-size: 18px; + + /* Center slide text vertically */ + display: flex; + justify-content: center; + align-items: center; +`; diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 1bb3a27..43b4ce8 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -1,8 +1,7 @@ import { useEffect } from 'react'; -import { Contents } from '@/components/HomePage/Contents'; +import { Contents } from '@/components/HomePage/LookAround/Contents'; import styled from '@emotion/styled'; - export const HomePage = () => { useEffect(() => { window.scrollTo(0, 0);