게임 속도 배율: 1배도 애니메이션·연출·컴퓨터 생각 시간을 예전의 1.5배로 늦추고, 관리자 사이트 설정 "게임 속도 배율"(1/16~16배, 기본 1)로 나눠 조절. 저장하면 열린 방에도 바로 적용(RoomView.gameSpeed 재전송)

- 서버: SiteSettings.gameSpeed, /api/config에 노출, 컴퓨터 생각 시간(defaultBotDelay)과 마피아·라이어 컴퓨터가 살펴보는 간격에 BOT_SLOWDOWN(1.5)/배율. 게임이 정한 반응 시각(원카드 외치기)은 그대로
- 웹: lib/motion.ts — .game-layout 안 CSS 애니메이션·트랜지션은 useMotionScope가 playbackRate로, Web Animations는 fxAnim, 연출 타이머(배너 유지·다음 단계·복사본 정리·숫자 세기·다시 보기 한 칸)는 fxMs. 채팅·role="timer"·규칙 시간·꾹 눌러 보기는 제외
- 관리자 사이트 탭에 배율 버튼(1/16~16)과 직접 입력
- 테스트: 배율 검증(API 400/200, 열린 방 즉시 반영), 컴퓨터 생각 시간 배율, motion 단위 테스트, e2e/speed.e2e.ts(돌 애니메이션 재생 배율·컴퓨터 응답 시간), 관리자 e2e에 배율 저장
- 문서: 14-admin §5, 07-ui-ux, 06-lobby-rooms, 13-decisions, README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-14 01:24:25 +09:00
parent 5e8f5b821f
commit 18ef402a6a
54 changed files with 536 additions and 134 deletions

View File

@@ -11,6 +11,7 @@ import { bump, cssEsc, flyFrom, flyGhost, fxEl, reducedMotion, seatEl, useBanner
import type { BoardProps, GameUI, OptionsProps } from '../types';
import { helpNow } from './help';
import { quickStart } from './quick';
import { fxAnim, fxMs } from '../../lib/motion';
const MODE_KO: Record<PokerMode, string> = {
holdem: '텍사스 홀덤',
@@ -308,19 +309,19 @@ const pokerSfx = {
declare: (delay = 0) => tone(660, 120, 'triangle', 0.1, delay, { slideTo: 990 }),
};
const later = (ms: number, f: () => void) => (ms > 0 ? setTimeout(f, ms) : f());
const later = (ms: number, f: () => void) => (ms > 0 ? setTimeout(f, fxMs(ms)) : f());
/** Card turned over in place (WAAPI so React's own style/transform stays). */
function flipIn(el: Element | null | undefined, delay = 0): void {
if (!el || reducedMotion() || typeof (el as HTMLElement).animate !== 'function') return;
(el as HTMLElement).animate(
fxAnim((el as HTMLElement).animate(
[
{ transform: 'perspective(600px) rotateY(90deg)' },
{ transform: 'perspective(600px) rotateY(-12deg)', offset: 0.6 },
{ transform: 'perspective(600px) rotateY(0deg)' },
],
{ duration: 420, delay, easing: 'ease', fill: 'backwards', composite: 'add' },
);
));
}
/**
@@ -337,19 +338,19 @@ function turnOver(el: Element | null | undefined, delay = 0): void {
back.setAttribute('aria-hidden', 'true');
Object.assign(back.style, { left: `${r.left}px`, top: `${r.top}px`, width: `${r.width}px`, height: `${r.height}px` });
document.body.appendChild(back);
const a = back.animate([{ transform: 'perspective(600px) rotateY(0deg)' }, { transform: 'perspective(600px) rotateY(-90deg)' }], { duration: half, delay, easing: 'ease-in', fill: 'both' });
const a = fxAnim(back.animate([{ transform: 'perspective(600px) rotateY(0deg)' }, { transform: 'perspective(600px) rotateY(-90deg)' }], { duration: half, delay, easing: 'ease-in', fill: 'both' }));
const done = () => back.remove();
a.onfinish = done;
a.oncancel = done;
setTimeout(done, delay + half + 1500);
(el as HTMLElement).animate(
setTimeout(done, fxMs(delay + half) + 1500);
fxAnim((el as HTMLElement).animate(
[
{ transform: 'perspective(600px) rotateY(90deg)' },
{ transform: 'perspective(600px) rotateY(-12deg)', offset: 0.65 },
{ transform: 'perspective(600px) rotateY(0deg)' },
],
{ duration: 300, delay: delay + half, easing: 'ease-out', fill: 'backwards', composite: 'add' },
);
));
}
/** The card elements of a seat on the table (forehead, hole, choice, up — same order as SeatCards). */