diff --git a/src/components/Book.tsx b/src/components/Book.tsx index 08155de..a995490 100644 --- a/src/components/Book.tsx +++ b/src/components/Book.tsx @@ -40,11 +40,22 @@ interface PageProps { } const Page = forwardRef((props, ref) => { + // 이미지의 소스 결정 const imageSource = props.number % 2 === 0 ? 'images/tmpRight.png' : 'images/tmpLeft.png'; + // 페이지의 왼쪽인지 오른쪽인지 결정 + const isLeftPage = props.number % 2 !== 0; + + // 조건에 따라 그림자 방향과 스타일을 설정 + const shadowClass = isLeftPage ? 'shadow-[10px_0_20px_rgba(0,0,0,0.5)]' : 'shadow-[-10px_0_20px_rgba(0,0,0,0.5)]'; + return ( -
- +
+
{props.children}
); @@ -262,31 +273,24 @@ const Book = forwardRef((props: BookProps, ref) => {
)} - {/*