M1 웹 + 배포: 홈·코드 입장·대기실·오목 화면·결과·계정, E2E, Docker/Caddy

- 웹(React+Vite): 홈(큰 버튼 2개·하던 게임 돌아가기), 6자리 코드 입력(붙여넣기 감지·자동 입장),
  링크 입장(닉네임 한 칸), 대기실(코드/링크 복사·공유·QR·자리·준비·방장 메뉴·설정),
  오목(SVG 판·두 번 눌러 확정·금수/위험 표시·시계·무르기·무승부·기권·키보드 조작·스크린리더 안내),
  결과(한 판 더 투표·방 전적·공정성 확인), 채팅·반응, 계정(닉네임 변경·글자 크기·테마·소리·진동)
- WS 클라이언트: 지수 백오프+지터 재연결, 화면 복귀/온라인 즉시 재연결, seq 순서 처리,
  ping/pong 지연·시계 보정, 서버 재시작 안내, 다른 창 접속 처리
- @bg/shared/lite: 브라우저용 진입점(zod 제외) → 첫 화면 JS 약 90KB gzip
- e2e/omok.e2e.ts: 브라우저 두 개(모바일·PC)로 방 만들기→링크 입장→대국→새로고침 복구→승리→한 판 더
- deploy: Dockerfile(운영 의존성만, 267MB), docker-compose(app+Caddy), Caddyfile(보안 헤더·CSP), .env.example
- 프록시 뒤에서만 X-Forwarded-For 신뢰(TRUST_PROXY=1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-04 04:37:33 +09:00
parent b1f3d7c500
commit 17b1d0fcda
46 changed files with 3590 additions and 90 deletions

View File

@@ -0,0 +1,530 @@
/* Design tokens: docs/07-ui-ux.md §2 */
:root {
--bg: #f7f5f0;
--surface: #ffffff;
--surface-2: #efece4;
--text: #1c1e21;
--text-sub: #4a4f57;
--border: #d9d5cb;
--primary: #2563eb;
--primary-press: #1d4fd0;
--primary-text: #ffffff;
--primary-soft: #dbe7ff;
--success: #15803d;
--success-soft: #dcfce7;
--warning: #b45309;
--warning-soft: #fef3c7;
--danger: #b91c1c;
--danger-soft: #fee2e2;
--felt: #1f6b4a;
--wood: #e3b76b;
--wood-line: #7a5a22;
--focus: #f59e0b;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
--radius: 12px;
--radius-lg: 16px;
--tap: 48px;
--btn-h: 56px;
color-scheme: light;
}
:root[data-theme='dark'] {
--bg: #16181d;
--surface: #20232a;
--surface-2: #2a2e37;
--text: #f2f3f5;
--text-sub: #b8bcc4;
--border: #3a3f4a;
--primary: #5b8def;
--primary-press: #4a7de0;
--primary-text: #0b1020;
--primary-soft: #1e2a44;
--success: #4ade80;
--success-soft: #133222;
--warning: #fbbf24;
--warning-soft: #3a2c0c;
--danger: #f87171;
--danger-soft: #3d1717;
--felt: #17513a;
--wood: #b98c45;
--wood-line: #4a3612;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
:root[data-theme='auto'] {
--bg: #16181d;
--surface: #20232a;
--surface-2: #2a2e37;
--text: #f2f3f5;
--text-sub: #b8bcc4;
--border: #3a3f4a;
--primary: #5b8def;
--primary-press: #4a7de0;
--primary-text: #0b1020;
--primary-soft: #1e2a44;
--success: #4ade80;
--success-soft: #133222;
--warning: #fbbf24;
--warning-soft: #3a2c0c;
--danger: #f87171;
--danger-soft: #3d1717;
--felt: #17513a;
--wood: #b98c45;
--wood-line: #4a3612;
--shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
color-scheme: dark;
}
}
/* Font scale setting: 보통 / 크게 / 아주 크게. Everything else is in rem. */
html {
font-size: 106.25%; /* 17px */
}
html[data-font-scale='large'] {
font-size: 127.5%;
}
html[data-font-scale='xlarge'] {
font-size: 148.75%;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
font-weight: 500;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-webkit-tap-highlight-color: transparent;
word-break: keep-all;
overflow-wrap: anywhere;
}
h1,
h2,
h3 {
margin: 0;
font-weight: 700;
line-height: 1.3;
}
h1 {
font-size: 1.65rem;
}
h2 {
font-size: 1.3rem;
}
h3 {
font-size: 1.1rem;
}
p {
margin: 0;
}
button,
input,
select {
font: inherit;
color: inherit;
}
:focus-visible {
outline: 3px solid var(--focus);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
/* ---------- layout ---------- */
.page {
max-width: 960px;
margin: 0 auto;
padding: 16px 16px calc(120px + env(safe-area-inset-bottom));
display: flex;
flex-direction: column;
gap: 20px;
}
.stack {
display: flex;
flex-direction: column;
gap: 12px;
}
.row {
display: flex;
gap: 8px;
align-items: center;
flex-wrap: wrap;
}
.card {
background: var(--surface);
border-radius: var(--radius-lg);
box-shadow: var(--shadow);
padding: 16px;
}
.muted {
color: var(--text-sub);
}
.small {
font-size: 0.9rem;
}
/* ---------- buttons ---------- */
.btn {
min-height: var(--btn-h);
min-width: var(--tap);
padding: 0 20px;
border-radius: var(--radius);
border: 2px solid transparent;
font-size: 1.06rem;
font-weight: 700;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
transition: transform 0.08s ease, background 0.15s ease;
text-decoration: none;
user-select: none;
}
.btn:active:not(:disabled) {
transform: scale(0.98);
}
.btn:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.btn-primary {
background: var(--primary);
color: var(--primary-text);
}
.btn-primary:hover:not(:disabled) {
background: var(--primary-press);
}
.btn-secondary {
background: var(--surface);
color: var(--text);
border-color: var(--border);
}
.btn-soft {
background: var(--primary-soft);
color: var(--text);
}
.btn-danger {
background: var(--surface);
color: var(--danger);
border-color: var(--danger);
}
.btn-success {
background: var(--success);
color: #fff;
}
.btn-block {
width: 100%;
}
.btn-sm {
min-height: var(--tap);
padding: 0 14px;
font-size: 0.95rem;
}
.btn-ghost {
background: transparent;
color: var(--text);
min-height: var(--tap);
padding: 0 12px;
}
/* ---------- inputs ---------- */
.input {
min-height: var(--btn-h);
width: 100%;
border-radius: var(--radius);
border: 2px solid var(--border);
background: var(--surface);
padding: 0 16px;
font-size: 1.1rem;
}
.input:focus {
border-color: var(--primary);
outline: none;
}
.field-error {
color: var(--danger);
font-size: 0.95rem;
}
label.field {
display: flex;
flex-direction: column;
gap: 6px;
font-weight: 700;
}
.segmented {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.segmented button {
min-height: var(--tap);
padding: 0 14px;
border-radius: 999px;
border: 2px solid var(--border);
background: var(--surface);
cursor: pointer;
font-weight: 600;
}
.segmented button[aria-pressed='true'] {
border-color: var(--primary);
background: var(--primary-soft);
font-weight: 700;
}
/* ---------- top bar ---------- */
.topbar {
position: sticky;
top: 0;
z-index: 20;
background: var(--bg);
display: flex;
align-items: center;
gap: 8px;
min-height: 56px;
padding: 4px 8px;
padding-top: calc(4px + env(safe-area-inset-top));
border-bottom: 1px solid var(--border);
}
.topbar-title {
flex: 1;
font-weight: 700;
font-size: 1.05rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* ---------- bottom action bar ---------- */
.bottom-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 15;
background: color-mix(in srgb, var(--bg) 92%, transparent);
backdrop-filter: blur(6px);
border-top: 1px solid var(--border);
padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.bottom-bar-inner {
max-width: 960px;
margin: 0 auto;
display: flex;
gap: 8px;
}
.bottom-bar-inner > * {
flex: 1;
}
/* ---------- banners & toasts ---------- */
.conn-banner {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 50;
background: var(--warning);
color: #fff;
text-align: center;
padding: 8px 12px;
padding-top: calc(8px + env(safe-area-inset-top));
font-weight: 700;
}
.toasts {
position: fixed;
top: calc(64px + env(safe-area-inset-top));
left: 50%;
transform: translateX(-50%);
z-index: 60;
display: flex;
flex-direction: column;
gap: 8px;
width: min(92vw, 420px);
pointer-events: none;
}
.toast {
background: var(--text);
color: var(--bg);
border-radius: var(--radius);
padding: 12px 16px;
font-weight: 600;
box-shadow: var(--shadow);
animation: toast-in 0.2s ease;
}
.toast.error {
background: var(--danger);
color: #fff;
}
@keyframes toast-in {
from {
opacity: 0;
transform: translateY(-8px);
}
}
/* ---------- sheets / modals ---------- */
.sheet-backdrop {
position: fixed;
inset: 0;
z-index: 40;
background: rgba(0, 0, 0, 0.45);
display: flex;
align-items: flex-end;
justify-content: center;
animation: fade 0.15s ease;
}
@media (min-width: 720px) {
.sheet-backdrop {
align-items: center;
}
}
.sheet {
background: var(--surface);
width: min(100%, 520px);
max-height: 88vh;
overflow: auto;
border-radius: 20px 20px 0 0;
padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
display: flex;
flex-direction: column;
gap: 16px;
animation: sheet-up 0.2s ease;
}
@media (min-width: 720px) {
.sheet {
border-radius: 20px;
}
}
@keyframes sheet-up {
from {
transform: translateY(24px);
opacity: 0;
}
}
@keyframes fade {
from {
opacity: 0;
}
}
/* ---------- avatar ---------- */
.avatar {
border-radius: 50%;
flex: none;
display: inline-flex;
align-items: center;
justify-content: center;
color: #fff;
font-weight: 700;
overflow: hidden;
}
.avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.badge {
display: inline-flex;
align-items: center;
gap: 4px;
border-radius: 999px;
padding: 2px 10px;
font-size: 0.85rem;
font-weight: 700;
background: var(--surface-2);
}
.badge.success {
background: var(--success-soft);
color: var(--success);
}
.badge.warning {
background: var(--warning-soft);
color: var(--warning);
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
display: inline-block;
}
/* Icon + small label stacked (keeps text with icons but saves width on phones). */
.icon-btn {
min-width: var(--tap);
min-height: var(--tap);
padding: 2px 8px;
border: 0;
background: transparent;
color: var(--text);
cursor: pointer;
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0;
border-radius: var(--radius);
font-size: 1.25rem;
line-height: 1.1;
position: relative;
}
.icon-btn .lbl {
font-size: 0.7rem;
font-weight: 700;
color: var(--text-sub);
}
.icon-btn .badge {
position: absolute;
top: 0;
right: 0;
padding: 0 6px;
font-size: 0.7rem;
}
.sheet:focus {
outline: none;
}
.board-wrap {
position: relative;
width: 100%;
max-width: min(100%, calc(100vh - 300px));
min-width: min(100%, 320px);
align-self: center;
}