웹: PC 중심 화면으로 재구성
- 공통 상단 메뉴(사이트 이름·홈·게임 목록·관리자·어디서나 코드 입력·내 정보) - 홈: 방 만들기 + 코드 입력 카드, 게임 격자, 지금 열린 공개 방 목록(/api/public-rooms) - 대기실: 두 칸(초대·설정 바로 수정·규칙 요약 / 자리·시작 버튼·채팅 항상 보임) - 게임 화면: 판(화면 높이에 맞춤, 좌표 표시) + 오른쪽 패널(상태·선수·시계·버튼·기보·채팅) - 오목: 마우스 올리면 미리 보기 돌, PC는 한 번 클릭으로 착수(두 번 눌러 확정은 터치 기기 기본값, 기기별 설정), GameUI에 Side 패널 추가 - 채팅: PC는 패널로 항상 표시(Enter로 바로 입력), 휴대폰은 시트 - 관리자: 왼쪽 사이드바, 사용자 표, 규칙 입력 두 칸 격자, 저장 바 고정 - 좁은 화면은 같은 화면을 한 칸으로 접어서 지원(방 상단 줄 줄바꿈 수정) - E2E: PC 1440×900 기준(방장 PC, 친구 휴대폰), 관리자 E2E도 PC Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,16 @@ export const DEFAULT_SETTINGS: Required<Settings> = {
|
||||
sound: true,
|
||||
vibrate: true,
|
||||
colorBlind: false,
|
||||
tapConfirm: true,
|
||||
// Two-step placing is the default only on touch devices; on PC one click places (docs/07 §3.5).
|
||||
tapConfirm: typeof matchMedia !== 'undefined' ? matchMedia('(pointer: coarse)').matches : true,
|
||||
};
|
||||
|
||||
/** Settings that belong to this device and are never synced to the account. */
|
||||
const DEVICE_ONLY = ['tapConfirm'] as const;
|
||||
const withoutDeviceOnly = (s: Settings): Settings => {
|
||||
const out: Record<string, unknown> = { ...s };
|
||||
for (const k of DEVICE_ONLY) delete out[k];
|
||||
return out as Settings;
|
||||
};
|
||||
|
||||
function loadLocal(): Required<Settings> {
|
||||
@@ -67,7 +76,7 @@ export const useSession = create<SessionState>((set, get) => ({
|
||||
api.config().catch(() => ({ discord: false, catalog: [] as CatalogEntry[], siteName: '같이 놀자 보드게임', announcement: '', maintenance: false })),
|
||||
api.me().catch(() => ({ me: null }) as Awaited<ReturnType<typeof api.me>>),
|
||||
]);
|
||||
const settings = { ...get().settings, ...(me.settings ?? {}) };
|
||||
const settings = { ...get().settings, ...withoutDeviceOnly(me.settings ?? {}) };
|
||||
applySettings(settings);
|
||||
localStorage.setItem(LS_KEY, JSON.stringify(settings));
|
||||
document.title = cfg.siteName;
|
||||
@@ -94,7 +103,7 @@ export const useSession = create<SessionState>((set, get) => ({
|
||||
applySettings(settings);
|
||||
localStorage.setItem(LS_KEY, JSON.stringify(settings));
|
||||
set({ settings });
|
||||
if (get().me) api.updateMe({ settings }).catch(() => {});
|
||||
if (get().me) api.updateMe({ settings: withoutDeviceOnly(settings) }).catch(() => {});
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user