블랙잭 화면 다시 만듦: 모든 조작을 가운데 판에, 큰 반원 테이블, 숫자·휠·칩 버튼 베팅, 카드 한 장씩 애니메이션

- board.tsx: 판 폭(최대 1180px) 반원 테이블(딜러·카드 슈·인쇄 문구·앞쪽 호의 자리, 내 자리는 가운데 앞 크게)
- 아래 조작판: 내 칩·시간 / 베팅(숫자 입력·Enter, −/+, 마우스 휠·↑↓(Shift 10배), 칩 버튼, 최소·절반·최대·지난 베팅, 막대) / 히트 H·스탠드 S·더블 D·스플릿 P·서렌더 R / 인슈어런스 / 결과·다음 판
- 옆 패널은 칩 순위와 놀이용 칩 안내만
- 카드는 나눠 주는 순서대로 450ms 간격으로 슈에서 날아오고 딜러 홀 카드는 뒤집힘, 합·결과는 카드가 놓인 뒤에
- 엔진: 처음 나눠 주기·딜러 차례에 장당 450ms를 다음 제한 시간에 더함(animLagMs)
- PlayingCard width 속성, 도움말·문서·e2e 스크린샷

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-17 01:29:31 +09:00
parent c10fac8e82
commit 02c2a8508c
8 changed files with 751 additions and 218 deletions

View File

@@ -89,9 +89,18 @@ function phaseMs(s: BlackjackState): number | null {
}
}
/**
* Time the screen spends dealing one card face up (client deal animation, docs §9). The opening deal and the dealer's
* play add this per card to the next clock, so the turn / result time starts when the cards have landed.
*/
export const BJ_DEAL_STEP_MS = 450;
function setClock(s: BlackjackState, now: number): void {
s.turnStartedAt = now;
const ms = phaseMs(s);
const lag = s.animLagMs ?? 0;
s.animLagMs = 0;
const base = phaseMs(s);
const ms = base === null ? null : base + lag;
s.deadlineMs = ms ?? 0;
s.deadlineAt = ms === null ? null : now + ms;
}
@@ -179,6 +188,7 @@ function deal(s: BlackjackState, ctx: Ctx): void {
s.dealer.push(draw(s, ctx));
s.dealerDown = true;
s.dealerBlackjack = handValue(s.dealer).total === 21;
s.animLagMs = (order.length * 2 + 2) * BJ_DEAL_STEP_MS;
log(s, { t: 'deal' });
ctx.events.push({ type: 'dealt' });
// Naturals are set now; they still compare to the dealer's natural.
@@ -245,6 +255,8 @@ function playDealer(s: BlackjackState, ctx: Ctx): void {
}
if (handValue(s.dealer).total > 21) log(s, { t: 'dealerBust', total: handValue(s.dealer).total });
}
// The hole card turns, then each drawn card lands one by one before the result shows.
s.animLagMs = (s.animLagMs ?? 0) + (s.dealer.length - 1) * BJ_DEAL_STEP_MS;
settleAndEnd(s, ctx);
}

View File

@@ -121,6 +121,8 @@ export interface BlackjackState {
handsPlayed: number;
deadlineAt: number | null;
deadlineMs: number;
/** Extra time for the deal animation, added once to the next clock (absent in older states = 0). */
animLagMs?: number;
turnStartedAt: number;
seq: number;
log: LogEntry[];