모든 게임이 남는 화면 전체를 쓰도록: 게임별 폭 상한 제거, 판·카드·말을 --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:
EJClaw
2026-10-17 16:17:15 +09:00
parent adc3b5337a
commit ca8baf5cc8
40 changed files with 1025 additions and 403 deletions

View File

@@ -175,6 +175,9 @@ button.rk-tile:disabled { cursor: default; }
.rk-result { display: grid; gap: 6px; }
.rk-result-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rk-mini { display: inline-flex; gap: 2px; flex-wrap: wrap; }
@media (min-width: 1100px) {
.rk-rack .rk-tile { --w: clamp(44px, var(--play-w) * .036, 58px); --h: calc(var(--w) * 1.36); }
}
@media (max-width: 1099px) {
.rk-table { min-height: 160px; }
}
@@ -331,7 +334,7 @@ function RummikubBoard({ view: v, me, players, act, pending, deadline }: BoardPr
const z = Number(localStorage.getItem('rk-zoom'));
return ZOOMS.includes(z) ? z : null;
});
const [boxW, setBoxW] = useState(0);
const [box, setBox] = useState({ w: 0, h: 0 });
const [msg, setMsg] = useState('');
const [confirm, setConfirm] = useState<null | 'draw' | 'commit'>(null);
const [announce, setAnnounce] = useState('');
@@ -383,19 +386,23 @@ function RummikubBoard({ view: v, me, players, act, pending, deadline }: BoardPr
// First-meld progress from what is on the board right now (new sets made of rack tiles only).
const meldNow = groups.filter((g) => g.ok && g.tileIds.every((id) => !onTable0.has(id))).reduce((a, g) => a + g.points, 0);
// Grid size: fit the width, zoom in on small screens (the board scrolls).
// Grid size: fit the width, zoom in on small screens (the board scrolls). On PC (fixed-height play area) the cells
// may grow past 64px as long as the first MIN_ROWS rows still fit the height.
useLayoutEffect(() => {
const el = boxRef.current;
if (!el) return;
setBoxW(el.clientWidth);
const wide = window.matchMedia('(min-width: 1100px)');
const update = () => setBox({ w: el.clientWidth, h: wide.matches ? el.clientHeight : 0 });
update();
if (typeof ResizeObserver === 'undefined') return;
const ro = new ResizeObserver(() => setBoxW(el.clientWidth));
const ro = new ResizeObserver(update);
ro.observe(el);
return () => ro.disconnect();
}, []);
const fit = boxW ? Math.floor((boxW - 2) / BOARD_COLS) : 36;
const fit = box.w ? Math.floor((box.w - 2) / BOARD_COLS) : 36;
const fitH = box.h ? Math.floor((box.h - 2) / MIN_ROWS / 1.36) : 0;
const z = zoom ?? (fit >= 30 ? 1 : fit >= 21 ? 1.5 : 2);
const cw = Math.max(16, Math.min(64, Math.round(fit * z)));
const cw = Math.max(16, Math.min(100, Math.round(Math.max(Math.min(fit, 64), Math.min(fit, fitH)) * z)));
const ch = Math.round(cw * 1.36);
const lowest = cells.reduce((m, x) => Math.max(m, x.r), -1);
const rows = Math.min(BOARD_ROWS, Math.max(MIN_ROWS, lowest + 2 + (hand ? 1 : 0)));