From dc1bd3bcba412f647822cefcb5d2fe9d14091e48 Mon Sep 17 00:00:00 2001 From: Nahyun Date: Wed, 4 Dec 2024 15:58:12 +0900 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20sseData=20rooms.length=EA=B0=80?= =?UTF-8?q?=20=EC=95=84=EB=8B=8C=20totalPages=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/hooks/useRoomsSSE.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fe/src/hooks/useRoomsSSE.ts b/fe/src/hooks/useRoomsSSE.ts index 00ebcec..3aeefef 100644 --- a/fe/src/hooks/useRoomsSSE.ts +++ b/fe/src/hooks/useRoomsSSE.ts @@ -19,7 +19,9 @@ export const useRoomsSSE = () => { setRooms(sseData.rooms); setPagination(sseData.pagination); - if (!sseData.rooms.length && userPage > 0) { + console.log(sseData.pagination.totalPages); + + if (sseData.pagination.totalPages === 1 && userPage > 0) { setUserPage(sseData.pagination.currentPage - 1); return; } From c1927adc36be268d8c4c2fcc51096196ea987c7e Mon Sep 17 00:00:00 2001 From: Nahyun Date: Wed, 4 Dec 2024 17:55:01 +0900 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=EB=B0=98=EC=9D=91=ED=98=95=20UI=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/index.css | 35 +++++++++++++++++-- .../pages/GamePage/GameScreen/EndScreen.tsx | 9 ++--- .../pages/GamePage/GameScreen/PlayScreen.tsx | 2 +- .../pages/GamePage/GameScreen/ReadyScreen.tsx | 28 +++++++++++---- .../pages/GamePage/PlayerList/PlayerList.tsx | 2 +- fe/src/pages/GamePage/index.tsx | 2 +- fe/src/pages/RoomListPage/index.tsx | 2 +- 7 files changed, 60 insertions(+), 20 deletions(-) diff --git a/fe/src/index.css b/fe/src/index.css index 3504613..7aad113 100644 --- a/fe/src/index.css +++ b/fe/src/index.css @@ -90,8 +90,17 @@ box-sizing: border-box; } -html, -body, +html { + height: 100%; + scroll-behavior: smooth; +} + +body { + height: 100%; + margin: 0; + overflow-x: hidden; +} + #root { height: 100%; } @@ -102,10 +111,30 @@ body { .app { @apply flex flex-col mx-auto justify-center max-w-[1074px] lg:px-0 p-8; + height: 100%; } .game-wrapper { - @apply relative w-full min-h-screen; + @apply relative w-full; + min-height: 100vh; +} + +@media (min-width: 768px) { + .game-wrapper { + height: 100vh; + overflow: hidden; + } +} + +@media (max-width: 767px) { + .game-wrapper { + height: auto; + overflow-y: visible; + } + + body { + overflow-y: auto; + } } .game-wrapper::before { diff --git a/fe/src/pages/GamePage/GameScreen/EndScreen.tsx b/fe/src/pages/GamePage/GameScreen/EndScreen.tsx index ee2bb96..233186d 100644 --- a/fe/src/pages/GamePage/GameScreen/EndScreen.tsx +++ b/fe/src/pages/GamePage/GameScreen/EndScreen.tsx @@ -48,14 +48,13 @@ const EndScreen = () => { }; return ( -
-
+
+
-
{rank.slice(0, 3).map((playerName, index) => ( { ))}
- { ))}
- { if (!turnData && !rank.length) return; return ( -
+
{gamePhase === 'intro' && ( { }; return ( -
+
{isHost ? (
); diff --git a/fe/src/pages/GamePage/PlayerList/PlayerList.tsx b/fe/src/pages/GamePage/PlayerList/PlayerList.tsx index 02ae2c3..7c408d4 100644 --- a/fe/src/pages/GamePage/PlayerList/PlayerList.tsx +++ b/fe/src/pages/GamePage/PlayerList/PlayerList.tsx @@ -10,7 +10,7 @@ const PlayerList = ({ players }: PlayerListProps) => { const emptySlots = RULES.maxPlayer - players.length; return ( -
+
{players.map((player) => ( ))} diff --git a/fe/src/pages/GamePage/index.tsx b/fe/src/pages/GamePage/index.tsx index b7fc787..2e5dec6 100644 --- a/fe/src/pages/GamePage/index.tsx +++ b/fe/src/pages/GamePage/index.tsx @@ -108,7 +108,7 @@ const GamePage = () => { return (
-
+
{ return (
-
+
{isEmpty ? ( From 50bb6d2a6065b8cad49b45c48bb6b1854369498a Mon Sep 17 00:00:00 2001 From: Nahyun Date: Wed, 4 Dec 2024 18:03:02 +0900 Subject: [PATCH 3/5] =?UTF-8?q?chore:=20=ED=83=80=EC=9D=B4=ED=8B=80?= =?UTF-8?q?=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fe/index.html b/fe/index.html index 0b9e79e..f7326da 100644 --- a/fe/index.html +++ b/fe/index.html @@ -10,7 +10,7 @@ href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css" /> - Clovapatra + 안녕! 클로바파트라
From 462fd9ee03e17244759f103acc760023600ef603 Mon Sep 17 00:00:00 2001 From: Nahyun Date: Wed, 4 Dec 2024 20:23:35 +0900 Subject: [PATCH 4/5] =?UTF-8?q?chore:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20console.log=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/hooks/useRoomsSSE.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/fe/src/hooks/useRoomsSSE.ts b/fe/src/hooks/useRoomsSSE.ts index 3aeefef..f74274d 100644 --- a/fe/src/hooks/useRoomsSSE.ts +++ b/fe/src/hooks/useRoomsSSE.ts @@ -19,8 +19,6 @@ export const useRoomsSSE = () => { setRooms(sseData.rooms); setPagination(sseData.pagination); - console.log(sseData.pagination.totalPages); - if (sseData.pagination.totalPages === 1 && userPage > 0) { setUserPage(sseData.pagination.currentPage - 1); return; From c0d674aeff730956db907662f7c8bb3065a0f973 Mon Sep 17 00:00:00 2001 From: Nahyun Date: Wed, 4 Dec 2024 20:24:08 +0900 Subject: [PATCH 5/5] =?UTF-8?q?chore:=20=EC=8B=9C=EC=83=81=EB=8C=80=20?= =?UTF-8?q?=EB=8B=89=EB=84=A4=EC=9E=84=20=EC=9C=84=EC=B9=98=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 완벽하게 커스텀하기 어려움 --- fe/src/pages/GamePage/GameScreen/EndScreen.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fe/src/pages/GamePage/GameScreen/EndScreen.tsx b/fe/src/pages/GamePage/GameScreen/EndScreen.tsx index 233186d..53f8f6f 100644 --- a/fe/src/pages/GamePage/GameScreen/EndScreen.tsx +++ b/fe/src/pages/GamePage/GameScreen/EndScreen.tsx @@ -29,11 +29,19 @@ const EndScreen = () => { }; const positions = { - 0: { top: '18%', left: '49.7%' }, - 1: { top: '54%', left: '34.5%' }, + 0: { top: '20%', left: '49.5%' }, + 1: { top: '54%', left: '38.5%' }, 2: { top: '68%', left: '60.5%' }, }; + const getRelativePosition = (index: number) => { + const position = positions[index as keyof typeof positions]; + return { + top: `calc(${position.top})`, + left: `calc(${position.left})`, + }; + }; + const getDelay = (index: number) => { switch (index) { case 2: @@ -55,14 +63,14 @@ const EndScreen = () => { loop={false} className="w-full max-w-2xl absolute left-1/2 transform -translate-x-1/2" /> +
{rank.slice(0, 3).map((playerName, index) => (