From 0d43d9f9aab01f999c82aa41174f776b38193069 Mon Sep 17 00:00:00 2001 From: EJClaw Date: Sat, 10 Oct 2026 00:04:07 +0900 Subject: [PATCH] =?UTF-8?q?PC=20=ED=99=94=EB=A9=B4=20=EC=A0=95=EB=A6=AC:?= =?UTF-8?q?=20=EC=9D=BD=EA=B8=B0=C2=B7=EC=9E=85=EB=A0=A5=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=EC=9D=80=20=EA=B0=80=EC=9A=B4=EB=8D=B0=20=EC=A2=81?= =?UTF-8?q?=EC=9D=80=20=EC=B9=B8,=20=EB=8C=80=EA=B8=B0=EC=8B=A4=20?= =?UTF-8?q?=EC=9E=90=EB=A6=AC=EB=A5=BC=20=EB=84=93=EC=9D=80=20=EC=B9=B8?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C,=20=EC=84=A4=EC=A0=95=20=EB=91=90=20?= =?UTF-8?q?=EC=B9=B8,=20=ED=99=88=20=ED=95=9C=20=ED=99=94=EB=A9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "PC버전을 좀더" 요청. 1440×900·1280×720·1920×1080에서 찍어 보니 휴대폰용 한 줄 배치를 1,200px로 늘린 화면이 흩어져 보였고, PC 대기실의 자리 카드는 400px 칸에 두 개씩 들어가 이름이 한 글자씩 꺾였다. - 게임 소개·코드로 참여·규칙: PC는 가운데 768px 칸(뒤로 줄도 같은 폭). 게임 소개 뒤로 줄의 이름 중복 제거. 코드 입력칸은 최대 520px. - 설정(/me): PC는 1080px 두 칸(왼쪽 프로필·로그아웃, 오른쪽 화면 설정·기록). 휴대폰은 그대로, 로그아웃 맨 아래. - 홈: 큰 버튼 3개를 낮은 가로 카드로, "게임 고르기" 제목과 종류 탭을 한 줄로. 1440×900에서 26개가 한 화면. 게임 고르기 창은 PC에서 두 줄. - 대기실(PC): 왼쪽 넓은 칸에 초대(한 줄) → 자리(2명 방 2칸, 5명 넘으면 3칸) → [컴퓨터 넣기][관전으로 바꾸기] → 시작(가운데 420px) → 채팅, 오른쪽에 게임 설정. 태블릿·휴대폰 배치는 그대로. - 방 막대 버튼: 마우스 환경에서 40px(막대 안에 여유), 터치는 48px. - docs/07 §3.2~3.5 갱신. Co-Authored-By: Claude Opus 5.5 --- apps/web/src/components/CodeInput.tsx | 2 +- apps/web/src/components/GameGrid.tsx | 30 +++-- apps/web/src/components/ui.tsx | 5 +- apps/web/src/pages/GamePage.tsx | 4 +- apps/web/src/pages/GamesPage.tsx | 3 +- apps/web/src/pages/Home.tsx | 15 +-- apps/web/src/pages/JoinPage.tsx | 4 +- apps/web/src/pages/MePage.tsx | 163 +++++++++++++------------- apps/web/src/pages/RoomPage.tsx | 48 +++++--- apps/web/src/pages/RulesPage.tsx | 4 +- apps/web/src/styles/global.css | 143 ++++++++++++++++++++++ docs/07-ui-ux.md | 20 +++- 12 files changed, 307 insertions(+), 134 deletions(-) diff --git a/apps/web/src/components/CodeInput.tsx b/apps/web/src/components/CodeInput.tsx index 14abc33..fe2e958 100644 --- a/apps/web/src/components/CodeInput.tsx +++ b/apps/web/src/components/CodeInput.tsx @@ -25,7 +25,7 @@ export function CodeInput({ onComplete, busy, autoFocus = true }: { onComplete: }; return ( -
+
diff --git a/apps/web/src/components/GameGrid.tsx b/apps/web/src/components/GameGrid.tsx index 566a473..bb0b77a 100644 --- a/apps/web/src/components/GameGrid.tsx +++ b/apps/web/src/components/GameGrid.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react'; +import { useState, type ReactNode } from 'react'; import { Link } from 'react-router'; import type { CatalogEntry } from '@bg/shared/lite'; import { GAME_GROUPS, GAME_ICON } from '../lib/catalog-ui'; @@ -7,24 +7,28 @@ import { GAME_GROUPS, GAME_ICON } from '../lib/catalog-ui'; * Game picker (docs/07 §3.3): small tiles with icon, name and one meta line. The one-line blurb and * difficulty live on the game page, so 26 games fit on a phone in a few screens. A tab row narrows the list. */ -export function GameGrid({ games }: { games: CatalogEntry[] }) { +export function GameGrid({ games, heading }: { games: CatalogEntry[]; heading?: ReactNode }) { const [group, setGroup] = useState('all'); const groups = GAME_GROUPS.filter((g) => games.some((x) => g.ids.includes(x.id))); const shown = group === 'all' ? games : games.filter((g) => GAME_GROUPS.find((x) => x.key === group)?.ids.includes(g.id)); return (
- {groups.length > 1 && ( -
- - {groups.map((g) => ( - - ))} -
- )} + {groups.map((g) => ( + + ))} +
+ )} +
{shown.map((g) => ( diff --git a/apps/web/src/components/ui.tsx b/apps/web/src/components/ui.tsx index b90bbc4..46612d7 100644 --- a/apps/web/src/components/ui.tsx +++ b/apps/web/src/components/ui.tsx @@ -150,9 +150,10 @@ export function CodeLabel({ code }: { code: string }) { return {formatRoomCode(code)}; } -export function TopBar({ title, onBack, right }: { title: ReactNode; onBack?: () => void; right?: ReactNode }) { +/** `width` lines the bar up with a `.page.narrow` / `.page.mid` column on PC. */ +export function TopBar({ title, onBack, right, width }: { title: ReactNode; onBack?: () => void; right?: ReactNode; width?: 'narrow' | 'mid' }) { return ( -
+ +
+ {display} + +
+

내 기록

+ {stats.length === 0 ? ( +

아직 끝까지 한 게임이 없어요.

+ ) : ( + stats.map((s) => ( +
+ {catalogById(s.gameId)?.nameKo ?? s.gameId} + + {s.played}판 {s.wins}승{s.draws ? ` ${s.draws}무` : ''} + +
+ )) + )} +
+ + +
{confirm === 'logout' && ( = 0 && ( -
-

친구에게 이 코드를 알려 주세요

-

+

+

친구에게 이 코드를 알려 주세요

+

{/* QR lives on the empty seat button ("+ 빈자리 · QR로 초대"), so this row stays two buttons. */} -
+
@@ -315,7 +315,8 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser })

자리 ({seated}/{room.maxPlayers})

-
4 ? '1fr 1fr' : '1fr', gap: 10 }}> + {/* PC: seats are the main column of the lobby, two or three cards per row. */} +
4 ? 3 : 2}, minmax(0, 1fr))` : '1fr', gap: 10 }}> {room.seats.map((s, i) => s && isBotId(s.user.id) ? (
@@ -354,7 +355,7 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser }) - {canAddBot && i === firstEmpty && ( + {canAddBot && i === firstEmpty && !wide && ( @@ -374,10 +375,19 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser }) ))}

)} - {mySeat >= 0 && room.allowSpectators && ( - + {((wide && canAddBot && firstEmpty >= 0) || (mySeat >= 0 && room.allowSpectators)) && ( +
+ {wide && canAddBot && firstEmpty >= 0 && ( + + )} + {mySeat >= 0 && room.allowSpectators && ( + + )} +
)}
); @@ -400,6 +410,7 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser }) {isHost && wide && }
); + const guestLine = me.kind === 'guest' && !practice && ; const action = (
@@ -428,18 +439,19 @@ function Lobby({ room, ui, me }: { room: RoomView; ui: GameUI; me: PublicUser }) return (
-
+ {/* PC: invite → seats → start → chat down the main column (the people), game settings on the side. */} +
{invite} - {wide ? settingsCard : seats} - {!wide && settingsCard} -
-
- {wide && seats} - {action} - {me.kind === 'guest' && !practice && } + {seats} + {wide ? action : settingsCard} + {wide && guestLine} {wide && }
+
+ {wide ? settingsCard : action} + {!wide && guestLine} +
{qr && setQr(false)} />} diff --git a/apps/web/src/pages/RulesPage.tsx b/apps/web/src/pages/RulesPage.tsx index 9ec9522..69b2445 100644 --- a/apps/web/src/pages/RulesPage.tsx +++ b/apps/web/src/pages/RulesPage.tsx @@ -16,8 +16,8 @@ export default function RulesPage() { const g = { nameKo: gameName(gameId) }; return ( <> - nav(-1)} /> -
+ nav(-1)} width="narrow" /> +
{ui && } {ui === undefined ?

불러오는 중…

: ui ? :

아직 준비 중인 게임이에요.

} diff --git a/apps/web/src/styles/global.css b/apps/web/src/styles/global.css index 969e1ad..35fd167 100644 --- a/apps/web/src/styles/global.css +++ b/apps/web/src/styles/global.css @@ -1369,3 +1369,146 @@ button.header-user { .setting-row .segmented { gap: 6px; } + +/* ===================================================================== + PC 정리 (2026-10-09, "PC버전을 좀더"): 넓은 화면에서 한 줄 화면을 1,200px로 늘리지 않는다. + ===================================================================== */ +/* 읽기·입력 화면(게임 소개, 코드로 참여, 규칙)은 가운데 좁은 칸, 설정은 중간 폭 두 칸. */ +.page.narrow, +.topbar.narrow { + max-width: 768px; +} +.page.mid, +.topbar.mid { + max-width: 1080px; +} +.topbar.narrow, +.topbar.mid { + padding-left: 24px; + padding-right: 24px; +} +@media (max-width: 719px) { + .topbar.narrow, + .topbar.mid { + padding-left: 16px; + padding-right: 16px; + } +} + +/* 설정(/me): PC는 왼쪽 프로필·계정, 오른쪽 설정·기록. 휴대폰은 한 줄, 계정 버튼은 맨 아래. */ +.me-side, +.me-main { + display: contents; +} +.me-account { + order: 1; +} +@media (min-width: 1100px) { + .me-page { + display: grid; + grid-template-columns: 340px minmax(0, 1fr); + gap: 24px; + align-items: start; + } + .me-side, + .me-main { + display: flex; + flex-direction: column; + gap: 20px; + min-width: 0; + } + .me-side { + position: sticky; + top: calc(var(--site-h) + 16px); + } +} + +/* 홈: 제목과 종류 탭은 한 줄, 큰 버튼 3개는 낮은 가로 카드(아이콘 왼쪽). 1440×900에서 게임 26개가 한 화면에. */ +.game-grid-head { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 12px 20px; +} +.game-grid-head > .game-tabs { + min-width: 0; + max-width: 100%; +} +@media (min-width: 720px) { + .home-action { + min-height: 0; + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: auto auto; + column-gap: 14px; + row-gap: 0; + align-items: center; + padding: 16px 20px; + } + .home-action-icon { + grid-row: 1 / 3; + margin-bottom: 0; + font-size: 2rem; + } + .home-action-title { + font-size: 1.2rem; + } + .game-card { + padding: 14px 10px 12px; + gap: 4px; + } + .game-card-icon { + font-size: 2.1rem; + } +} +/* 게임 고르기 창: PC에서는 두 줄로 나란히. */ +.picker-list { + display: flex; + flex-direction: column; + gap: 8px; +} +@media (min-width: 720px) { + .picker-list { + display: grid; + grid-template-columns: 1fr 1fr; + } +} + +/* 대기실(PC): 초대 카드는 한 줄(코드 왼쪽, 버튼 오른쪽), 시작 버튼은 자리 아래 가운데. */ +@media (min-width: 1100px) { + .invite-card { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + grid-template-areas: 'label buttons' 'code buttons'; + align-items: center; + column-gap: 24px; + row-gap: 0; + text-align: left !important; + padding: 16px 20px; + } + .invite-label { + grid-area: label; + } + .invite-code { + grid-area: code; + font-size: 2.6rem !important; + } + .invite-buttons { + grid-area: buttons; + } + .lobby .bottom-bar.inline-wide .bottom-bar-inner { + max-width: 420px; + width: 100%; + margin: 0 auto; + } + .lobby .guest-warning { + text-align: center; + } +} + +/* 방 막대(마우스): 버튼을 40px로 낮춰 52px 막대 안에 여유를 둔다. 터치 기기는 48px 그대로. */ +@media (min-width: 720px) and (hover: hover) and (pointer: fine) { + .room-bar .btn { + min-height: 40px; + } +} diff --git a/docs/07-ui-ux.md b/docs/07-ui-ux.md index dc43671..35de84d 100644 --- a/docs/07-ui-ux.md +++ b/docs/07-ui-ux.md @@ -65,6 +65,8 @@ - 오른쪽에 테마 버튼(🌙/☀️)을 둔다. 누를 때마다 밝은 화면 ↔ 어두운 화면으로 바뀌고, `/me`의 '화면 색' 설정과 같은 값을 쓴다('자동'이면 지금 보이는 색의 반대로). 코드로 참여는 홈의 [🔢 코드로 참여](→ `/j`)로 한다. - 오른쪽 끝: 로그인 전에는 [로그인](→ `/login`: 큰 [디스코드로 로그인], 아래 [게스트로 시작하기] → `/login/guest`에서 계정 이름 정하기). 로그인 뒤에는 닉네임(디스코드로 가입했으면 디스코드 이름)을 보이고, 누르면 [⚙️ 설정](→ `/me`)·[🚪 로그아웃] 메뉴가 열린다. 테마 버튼 말고 글자 크기·소리 같은 설정은 `/me`에 있다. - 내용 폭은 최대 1280px, 가운데 정렬. 게임 화면만 화면 전체 폭을 쓴다. +- 한 줄로 읽고 입력하는 화면(게임 소개 `/g/:id`, 코드로 참여 `/j`, 규칙 `/rules/:id`)은 PC에서 가운데 768px 칸만 쓴다. 휴대폰용 한 줄 배치를 1,200px로 늘리면 버튼·입력칸·글 줄이 너무 길어져 오히려 흩어져 보인다(2026-10-09). 페이지 위 [← 뒤로] 줄도 같은 폭(`TopBar width`). +- 설정(`/me`)은 PC에서 1080px 두 칸: 왼쪽 프로필·로그아웃(따라 내려옴), 오른쪽 화면 설정·기록. 휴대폰은 한 줄이고 로그아웃은 맨 아래. ### 3.3 홈 (PC) ``` @@ -72,22 +74,27 @@ │ [▶ 하던 게임으로 돌아가기] (있을 때만) │ │ [+ 방 만들기 (파란 큰 버튼)] [🔢 코드로 참여 → /j] [🤖 컴퓨터와 연습] │ ├──────────────────────────────────────────────────────────────────────────┤ -│ [전체] [판·주사위] [카드·패] [여럿이 파티] ← 종류 탭 │ +│ 🎮 게임 고르기 [전체] [판·주사위] [카드·패] [여럿이 파티] ← 제목과 종류 탭 한 줄 │ │ 게임 타일 격자 (PC 자동 열, 휴대폰 3열. 타일 = 아이콘·이름·"2명 · 5~15분") │ └──────────────────────────────────────────────────────────────────────────┘ ``` - 첫 화면에 다 넣지 않는다. 설명 글은 버튼 아래 한 줄만, 나머지는 탭이나 버튼을 눌러 들어간다. - 게임 한 줄 소개와 난이도는 게임 소개(`/g/:id`)에만 둔다. 휴대폰에서 26개가 세 화면 남짓에 들어온다. - 휴대폰: [+ 방 만들기]는 한 줄 전체, [코드로 참여]·[컴퓨터와 연습]은 그 아래 나란히. +- PC·태블릿: 큰 버튼 3개는 아이콘을 왼쪽에 둔 낮은 가로 카드. 1440×900에서 게임 26개가 스크롤 없이 한 화면에 들어온다. [방 만들기]·[컴퓨터와 연습]의 게임 고르기 창은 두 줄로 나란히. ### 3.4 대기실 (PC) ``` -┌──────────────────────────────┬────────────────────────────────┐ -│ 초대 카드(빈자리 있을 때만) │ 자리 목록(2~10칸 격자) │ -│ 게임 설정(펼쳐서 바로 수정 — 방장) │ [게임 시작] / [준비하기] │ -│ │ 채팅(항상 보임) │ -└──────────────────────────────┴────────────────────────────────┘ +┌──────────────────────────────────────────────┬──────────────────────┐ +│ 초대 카드 한 줄(빈자리 있을 때만): 코드 | [링크 복사][초대글 복사] │ 게임 설정 │ +│ 자리 카드(2명 방은 2칸, 5명 넘으면 3칸씩) │ (펼쳐서 바로 수정 — 방장) │ +│ [🤖 컴퓨터 넣기] [관전으로 바꾸기] │ │ +│ [▶ 게임 시작] / [준비하기] (가운데 420px) │ │ +│ 채팅 │ │ +└──────────────────────────────────────────────┴──────────────────────┘ ``` +- 사람에 관한 것(초대 → 자리 → 시작 → 채팅)은 넓은 왼쪽 칸에 위에서 아래로, 가끔 보는 게임 설정은 오른쪽 400px 칸. 오른쪽 칸에 자리 카드를 두 칸씩 넣으면 이름이 한 글자씩 꺾여서(2026-10-09) 자리를 넓은 칸으로 옮겼다. +- 태블릿·휴대폰은 한 줄: 초대 → 자리 → 게임 설정, 시작 버튼은 아래(휴대폰은 화면 아래 고정). ### 3.5 게임 화면 (PC) ``` @@ -104,6 +111,7 @@ - 카드 게임: 판 자리에 원형 테이블, 나는 항상 아래, 내 패는 판 아래쪽 넓게. - PC 조작: 마우스를 올리면 미리 보기 돌(반투명), 클릭 한 번에 착수(기본값). "두 번 눌러 확정"은 터치 기기의 기본값이고 설정에서 바꿀 수 있다. - 단축키: `Enter` 채팅 입력, `Esc` 창 닫기, 방향키+`Enter` 판 조작. +- 방 막대 버튼은 마우스 환경에서 40px(막대 52px 안에 여유), 터치 기기에서는 48px. - 방 안(대기실·게임·결과)에서는 사이트 상단 메뉴를 숨기고 방 막대(← 홈 · 게임 이름 · 🔗 방 코드 · 📖 규칙 · ⚙️ 설정 · 🚪 나가기) 한 줄만 둔다. 판이 그만큼 커진다. 높이 계산은 CSS 변수 `--site-h`(방 안에서는 0)를 쓴다. - 채팅의 빠른 반응(이모지·짧은 말)은 한 줄. 넘치면 옆으로 밀어 본다. - 결과 창: 진한 버튼은 [🔁 한 판 더] 하나. [판 보기]·[▶ 다시 보기]는 한 줄에 나란히, [방 나가기]는 글자 버튼, 공정성 확인은 접어 둔다.