모든 게임이 남는 화면 전체를 쓰도록: 게임별 폭 상한 제거, 판·카드·말을 --play-w/--play-h에 맞춰 키움
- 카드 게임: 펠트가 남는 높이를 채우고 손패·가운데 더미·자리 크기가 화면에 따라 커짐 - 판 게임: 체스·바둑·오목 등은 높이를 다 쓰고, 장기·쿼리도·젬블로는 넓은 화면에서 조작판을 판 옆으로 - 섯다: 자리를 판 크기에 맞춘 타원 위에 고르게 두고, 많을 때 자리 크기를 줄여 8명에서도 겹치지 않게 - 바퀴벌레 포커 6명·야단법석 달리기 5명 선수 뽑기가 PC에서 넘치지 않게 - 휴대폰·태블릿(1100px 아래) 배치는 그대로 - layout-survey: 컴퓨터 넣기 버튼 기다림, 넘친 높이(px) 표시 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -158,7 +158,7 @@ function Bump({ value, children }: { value: number; children?: ReactNode }) {
|
||||
|
||||
const CSS = `
|
||||
.game-main:has(> .mj) { justify-content: flex-start; }
|
||||
.mj { position: relative; width: 100%; max-width: 1080px; display: flex; flex-direction: column; gap: 8px; align-self: center; }
|
||||
.mj { position: relative; width: 100%; display: flex; flex-direction: column; gap: 8px; align-self: center; }
|
||||
.mj.wide { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'table side' 'me me'; align-items: start; gap: 8px 12px; }
|
||||
.mj.wide .mj-opps { grid-area: side; flex-direction: column; flex-wrap: nowrap; }
|
||||
.mj.wide .mj-seat { max-width: none; flex: none; }
|
||||
@@ -443,7 +443,7 @@ const ROT = [0, -90, 180, 90];
|
||||
function Table({ v, players, width, callout, seen }: { v: MahjongView; players: Record<string, PublicUser>; width: number; callout: ReactNode; seen: Seen | null }) {
|
||||
// Pond: 6 tiles per row (+ room for one sideways riichi tile) × 4 rows. Table = H + W + H.
|
||||
// Total width ≈ 2H + W + padding/border = 17·tw + 37.
|
||||
const tw = Math.max(14, Math.min(30, Math.floor((width - 37) / 17)));
|
||||
const tw = Math.max(14, Math.min(64, Math.floor((width - 37) / 17)));
|
||||
const th = Math.round((tw * 4) / 3);
|
||||
const W = 5 * (tw + 1) + th + 2;
|
||||
const H = 4 * (th + 1) + 2;
|
||||
@@ -560,7 +560,7 @@ function MyArea({
|
||||
const beginner = my.prefs.beginner && v.options.beginnerMode;
|
||||
const phone = width > 0 && width < 600;
|
||||
const meldW = phone ? 18 : 26;
|
||||
const tw = width > 0 ? Math.max(20, Math.min(phone ? 40 : 48, Math.floor((width - 14 - n) / n))) : 40;
|
||||
const tw = width > 0 ? Math.max(20, Math.min(phone ? 40 : 60, Math.floor((width - 14 - n) / n))) : 40;
|
||||
|
||||
const send = (code: string) => {
|
||||
if (pending) return;
|
||||
@@ -1153,15 +1153,15 @@ function MahjongBoard({ view: v, me, players, act, pending, deadline, tapConfirm
|
||||
const phone = width > 0 && width < 600;
|
||||
// PC: table on the left sized to the screen height, other players on the right, my hand below.
|
||||
const wide = width >= 900;
|
||||
const reserve = v.my ? 290 : 20;
|
||||
const tableWidth = wide ? Math.max(380, Math.min(width - 330, mainH > 0 && wide ? mainH - reserve : 560, 600)) : width || 360;
|
||||
const reserve = v.my ? 300 : 20;
|
||||
const tableWidth = wide ? Math.max(380, Math.min(width - 330, mainH > 0 && wide ? mainH - reserve : 560)) : width || 360;
|
||||
const showTable = v.phase === 'playing' || (v.phase === 'handResult' && !wide);
|
||||
return (
|
||||
<div className={`mj${wide ? ' wide' : ''}`} ref={ref}>
|
||||
<style>{CSS}</style>
|
||||
<ul className="mj-opps" aria-label="다른 사람">
|
||||
{others.map((s) => (
|
||||
<SeatChip key={s.seat} v={v} s={s} players={players} me={me} deadline={deadline} w={phone ? 13 : 18} seen={seen} />
|
||||
<SeatChip key={s.seat} v={v} s={s} players={players} me={me} deadline={deadline} w={phone ? 13 : wide ? 24 : 18} seen={seen} />
|
||||
))}
|
||||
</ul>
|
||||
<div className="mj-main" style={wide ? { width: tableWidth, maxHeight: mainH > 0 ? mainH - 12 : undefined } : undefined}>
|
||||
|
||||
Reference in New Issue
Block a user