From 6c1a037e214056bb3223908e2faa79c560962ad3 Mon Sep 17 00:00:00 2001 From: choihooo Date: Mon, 29 Jul 2024 17:33:56 +0900 Subject: [PATCH] =?UTF-8?q?design:=20=EA=B7=B8=EB=A6=BC=EC=9E=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Book.tsx | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) 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) => {
)} - {/*