diff --git a/src/assets/menu-svgrepo-com.svg b/src/assets/menu-svgrepo-com.svg new file mode 100644 index 0000000..c644c2a --- /dev/null +++ b/src/assets/menu-svgrepo-com.svg @@ -0,0 +1,19 @@ + + + \ No newline at end of file diff --git a/src/components/Content.tsx b/src/components/Content.tsx index 95cb7ab..04ad433 100644 --- a/src/components/Content.tsx +++ b/src/components/Content.tsx @@ -4,9 +4,7 @@ import { Carousel } from "./Carousel"; import profileDefault from "../assets/user_default.jpg"; import StarRating from "./StarRating"; import CommentCard from "./CommentCard"; - import { CommentsResType, CommentType, MovieType } from "../type"; - import { MyStateType } from "../type"; import { Link, useOutletContext } from "react-router-dom"; import { defaultResponseHandler } from "../apis/custom"; diff --git a/src/components/RecentlyViewedContents.module.scss b/src/components/RecentlyViewedContents.module.scss new file mode 100644 index 0000000..d1aff9e --- /dev/null +++ b/src/components/RecentlyViewedContents.module.scss @@ -0,0 +1,122 @@ +@import "../utils/common.module.scss"; + +// 포지션 설정 +.fixedPositionCon { + @include pageContainer; + position: fixed; + top: calc(62px + ((100vh - 62px) / 2)); + left: 0; + right: 0; + + .relativePostionCon { + position: relative; + width: 100%; + + .absolutePostionCon { + position: absolute; + top: 50%; + left: 100%; + transform: translate(calc(-50%), -50%); + + margin-left: 180px; + @media (max-width: #{$max-screen + 700}) { + margin-left: calc((100vw - 100%) / 4); + } + @media (max-width: #{$max-screen + 480}) { + margin-left: 120px; + } + @media (max-width: #{$max-screen + 240}) { + margin-left: 60px; + } + @media (max-width: #{$medium-screen + 100}) { + margin-left: 20px; + } + } + } +} + +// 스타일 설정 +.listOpenIcon { + width: 60px; + height: 60px; + border-radius: 50%; + background-image: url("../assets/menu-svgrepo-com.svg"); + background-repeat: no-repeat; + background-position: center; + background-color: white; + box-shadow: 0 2px 10px #aaaaaa; +} + +.cardListCon { + padding-right: 10px; + + @media (max-width: #{$max-screen + 480}) { + transform: translate(calc(-10px - 50% + (100vw - 1560px) / 2)); + } + @media (max-width: #{$max-screen + 240}) { + transform: translate(calc(-10px - 50% + (100vw - 1440px) / 2)); + } + @media (max-width: #{$max-screen + 120}) { + transform: translate(calc(-50%)); + } +} +.cardList { + width: 200px; + max-height: 80vh; + padding: 0 20px; + border: 1px solid $light-gray; + border-radius: 10px; + background-color: #eeeeee; + overflow-y: scroll; + + @keyframes expandVertically { + 0% { + transform: scaleY(0); + } + 100% { + transform: scaleY(1); + } + } + animation: expandVertically 0.3s ease forwards; + + &::-webkit-scrollbar { + width: 10px; + } + &::-webkit-scrollbar-track { + border-radius: 10px; + } + &::-webkit-scrollbar-thumb { + background: $light-gray; + border-radius: 10px; + } + &::-webkit-scrollbar-thumb:hover { + background: #bbbbbb; + } + + header { + padding: 10px 0; + h2 { + font-size: 15px; + } + } + ul { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + li { + list-style-type: none; + + img { + width: 100%; + } + .contentTitleBox { + margin-top: -4px; + padding-bottom: 16px; + font-size: 14px; + font-weight: 500; + } + } + } +} diff --git a/src/components/RecentlyViewedContents.tsx b/src/components/RecentlyViewedContents.tsx new file mode 100644 index 0000000..bf7b6ef --- /dev/null +++ b/src/components/RecentlyViewedContents.tsx @@ -0,0 +1,47 @@ +import { useState } from "react"; +import styles from "./RecentlyViewedContents.module.scss"; +import { Link } from "react-router-dom"; +import useRecentContents from "../hooks/useRecentContents"; + +export default function RecentlyViewedContents() { + const [isOpenRecentContents, setIsOpenRecentContents] = useState(false); + const { recentContents } = useRecentContents(); + + return ( +