모든 게임: 결과·팝업은 애니메이션이 끝난 뒤에, 증강 윷놀이: 이의있음!이 다음 판에도 뜨게, 증강 고르는 목록·나오게 할 증강을 팝업 목록으로

- lib/motion: motionBusy / useMotionHold / useMotionSettled / useAfterMotionValue / AfterMotion
- 방 화면: 결과 창과 상태 줄은 판이 멈춘 뒤에(실시간 게임은 상태 줄 그대로), 새 판마다 판 화면을 새로 그림
  (결과 창에 둔 채 다음 판이 시작되면 이전 판의 효과 번호가 남아 이의있음!·알림이 안 뜨던 문제)
- 41개 게임: 결과 패널·배너·점수·팝업이 마지막 움직임 뒤에 나오도록 게임별로 정리
- 증강 윷놀이: 명탐정·배달·손버릇·따라쟁이·착각 대상은 아이콘과 설명이 다 보이는 목록에서,
  방 설정의 나오게 할 증강은 팝업 목록에서 스위치로 켜고 끔
- e2e: 늦게 바뀌는 상태 줄·결과 창과 새 증강 화면에 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-11-08 09:07:27 +09:00
parent f18909c44f
commit 4e0eb4d52c
52 changed files with 2142 additions and 855 deletions

View File

@@ -8,7 +8,7 @@ import { haptic, noise, sfx, tone } from '../../lib/feedback';
import type { BoardProps, GameUI, OptionsProps } from '../types';
import { helpNow } from './help';
import { quickStart } from './quick';
import { fxMs } from '../../lib/motion';
import { AfterMotion, fxMs, useAfterMotionValue, useMotionHold, useMotionSettled } from '../../lib/motion';
const ROLL_MS = 650;
const HOUSE = 'house';
@@ -309,6 +309,16 @@ function LasVegasBoard({ view: v, me, players, act, pending }: BoardProps<LasVeg
const [announce, setAnnounce] = useState('');
const prevRoll = useRef(v.rollSeq);
const prevView = useRef(v);
// The dice tumble (timers + flicking faces): what was rolled shows only after it.
useMotionHold(rolling);
// A round's banner ("+30점") waits until its settlement has been dealt out on the screen.
const [bannerNext, setBannerNext] = useState<{ text: string; sub?: string; key: number } | null>(null);
const bannerReady = useMotionSettled(!!bannerNext);
useEffect(() => {
if (!bannerReady || !bannerNext) return;
setBanner(bannerNext);
setBannerNext(null);
}, [bannerReady]); // eslint-disable-line react-hooks/exhaustive-deps
// New roll: tumble animation + screen-reader text.
useLayoutEffect(() => {
@@ -387,11 +397,15 @@ function LasVegasBoard({ view: v, me, players, act, pending }: BoardProps<LasVeg
settleSound(delay + 150, ties, awards.length, mineAw.length > 0, more);
const seated = !!me && v.seats.includes(me) && !v.conceded.includes(me);
const got = mineAw.reduce((t, a) => t + (a.note ?? 0), 0);
setBanner({
text: more ? `${rr.round}라운드 정산` : '최종 정산',
sub: seated ? (mineAw.length ? `+${got}점 (${mineAw.length}장)` : '이번엔 못 받았어요') : undefined,
key: v.roundResults.length,
});
// The last one only announces the final settlement right away (the room's result window waits for it); the
// amounts are in the final table that follows.
if (more) {
setBannerNext({
text: `${rr.round}라운드 정산`,
sub: seated ? (mineAw.length ? `+${got}점 (${mineAw.length}장)` : '이번엔 못 받았어요') : undefined,
key: v.roundResults.length,
});
} else setBanner({ text: '최종 정산', key: v.roundResults.length });
if (more) setDealt(v.round);
haptic([50, 30, 50]);
}
@@ -467,7 +481,9 @@ function LasVegasBoard({ view: v, me, players, act, pending }: BoardProps<LasVeg
)}
{v.result && lastRR && (
<div className="lv-lower">
<FinalTable v={v} me={me} players={players} />
<AfterMotion>
<FinalTable v={v} me={me} players={players} />
</AfterMotion>
<Settlement round={lastRR.round} payouts={lastRR.payouts} v={v} me={me} players={players} />
</div>
)}
@@ -759,6 +775,8 @@ function LasVegasSide({ view: v, me, players, act, deadline }: BoardProps<LasVeg
const [ask, setAsk] = useState(false);
const total = v.options.turnSeconds ? v.options.turnSeconds * 1000 : 30_000;
const mine = me ? v.money[me] : undefined;
const myCount = useAfterMotionValue(mine?.count ?? 0);
const myTotal = useAfterMotionValue(mine?.total ?? 0);
const playing = v.phase !== 'finished';
return (
<>
@@ -792,17 +810,7 @@ function LasVegasSide({ view: v, me, players, act, deadline }: BoardProps<LasVeg
{out ? '기권' : v.away.includes(p) ? '자리 비움' : playing ? `주사위 ${h.own}${v.neutralPer ? ` · 흰 ${h.neutral}` : ''}` : '끝'}
</div>
</div>
<span
style={{ textAlign: 'right', fontVariantNumeric: 'tabular-nums' }}
aria-label={`${nick(players, p)} 지폐 ${m.count}장${m.total !== null ? `, ${m.total}점` : ''}`}
>
<strong style={{ fontSize: '1.2rem' }}>
<Bump value={m.total}>{m.total !== null ? `${m.total}점` : '?'}</Bump>
</strong>
<div className="small muted">
<Bump value={m.count}>{m.count}장</Bump>
</div>
</span>
<Money name={nick(players, p)} total={m.total} count={m.count} />
{turn && playing && <TurnTimer deadline={deadline} totalMs={total} mine={p === me} size={40} />}
</div>
);
@@ -813,7 +821,7 @@ function LasVegasSide({ view: v, me, players, act, deadline }: BoardProps<LasVeg
<div className="row small" style={{ justifyContent: 'space-between' }}>
<strong>내 지폐</strong>
<span>
{mine.count}장 · {mine.total ?? 0}점
{myCount}장 · {myTotal}점
</span>
</div>
<MyBills notes={mine.notes ?? []} />
@@ -843,6 +851,22 @@ function LasVegasSide({ view: v, me, players, act, deadline }: BoardProps<LasVeg
);
}
/** A seat's money; changes once the settlement has been dealt out on the board. */
function Money({ name, total: totalNow, count: countNow }: { name: string; total: number | null; count: number }) {
const total = useAfterMotionValue(totalNow);
const count = useAfterMotionValue(countNow);
return (
<span style={{ textAlign: 'right', fontVariantNumeric: 'tabular-nums' }} aria-label={`${name} 지폐 ${count}장${total !== null ? `, ${total}점` : ''}`}>
<strong style={{ fontSize: '1.2rem' }}>
<Bump value={total}>{total !== null ? `${total}점` : '?'}</Bump>
</strong>
<div className="small muted">
<Bump value={count}>{count}장</Bump>
</div>
</span>
);
}
/** My bills; the ones just received fly in (my own amounts are always visible to me). */
function MyBills({ notes }: { notes: number[] }) {
const sig = notes.join(',');