From 99c25cb260c769f4271be8e5ce3b09d1829aa30a Mon Sep 17 00:00:00 2001 From: EJClaw Date: Tue, 13 Oct 2026 13:37:26 +0900 Subject: [PATCH] =?UTF-8?q?=EC=95=BC=EB=8B=A8=EB=B2=95=EC=84=9D=20?= =?UTF-8?q?=EB=8B=AC=EB=A6=AC=EA=B8=B0:=20=EC=A3=BC=EC=82=AC=EC=9C=84?= =?UTF-8?q?=C2=B7=EB=B0=9C=EA=B1=B8=EC=9D=8C=C2=B7=EB=8A=A5=EB=A0=A5=C2=B7?= =?UTF-8?q?=EC=B9=B8=20=ED=9A=A8=EA=B3=BC=C2=B7=EA=B2=B0=EC=8A=B9=20?= =?UTF-8?q?=EC=86=8C=EB=A6=AC,=20=EB=A7=90=EC=9D=B4=20=EB=9B=B0=EB=8A=94?= =?UTF-8?q?=20=EC=9B=80=EC=A7=81=EC=9E=84=C2=B7=EB=84=98=EC=96=B4=EC=A7=90?= =?UTF-8?q?=C2=B7=EB=A9=94=EB=8B=AC,=20=EB=BD=91=EA=B8=B0=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=20=EB=93=B1=EC=9E=A5;=20E2E:=20=EA=B7=B8=EB=A6=BC=20?= =?UTF-8?q?=EB=A7=9E=ED=9E=88=EA=B8=B0=C2=B7=ED=81=B4=EB=A3=A8=C2=B7?= =?UTF-8?q?=EB=9D=BC=EC=9D=B4=EC=96=B4=C2=B7=EB=A7=88=ED=94=BC=EC=95=84=20?= =?UTF-8?q?=ED=88=AC=ED=91=9C=EB=A5=BC=20=EC=8B=9C=EA=B0=84=20=EB=AC=B4?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=EC=9C=BC=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- apps/web/src/games/magical-athlete/index.tsx | 88 ++++++++++++++++---- e2e/games.e2e.ts | 29 ++++--- 2 files changed, 89 insertions(+), 28 deletions(-) diff --git a/apps/web/src/games/magical-athlete/index.tsx b/apps/web/src/games/magical-athlete/index.tsx index 81ddccb..f66ba02 100644 --- a/apps/web/src/games/magical-athlete/index.tsx +++ b/apps/web/src/games/magical-athlete/index.tsx @@ -5,7 +5,7 @@ import { RACERS, type RacerId } from '@bg/games/magical-athlete/racers'; import type { PublicUser } from '@bg/shared/lite'; import { Avatar, ConfirmSheet } from '../../components/ui'; import { TurnTimer } from '../../components/TurnTimer'; -import { haptic, sounds } from '../../lib/feedback'; +import { haptic, sfx, sounds, tone } from '../../lib/feedback'; import type { BoardProps, GameUI, OptionsProps } from '../types'; import { helpNow } from './help'; import { quickStart } from './quick'; @@ -20,6 +20,27 @@ const seatColor = (v: MagicalAthleteView, p: string) => COLORS[v.seats.indexOf(p const rname = (id: RacerId) => `${RACERS[id].emoji} ${RACERS[id].name}`; const who = (players: Record, me: string | null, p: string) => (p === me ? '๋‚˜' : nick(players, p)); +/** Game sounds on top of the shared palette (site volume applies); `d` = delay in ms (after the dice lands). */ +const maSound = { + /** Footsteps along the track. */ + steps: (d: number) => { + for (let i = 0; i < 3; i++) tone(i % 2 ? 560 : 470, 45, 'triangle', 0.09, d + i * 90); + }, + /** A racer's power: a quick sparkle up. */ + power: (d: number) => [880, 1175, 1568].forEach((f, i) => tone(f, 90, 'triangle', 0.08, d + i * 60)), + /** Star space (+1 point). */ + star: (d: number) => { + tone(1318, 70, 'square', 0.05, d); + tone(1976, 160, 'square', 0.05, d + 70); + }, + /** Rock space: tripped. */ + trip: (d: number) => tone(300, 200, 'sawtooth', 0.05, d, { slideTo: 150 }), + /** Arrow space: slide forward / back. */ + arrow: (d: number, up: boolean) => tone(up ? 500 : 900, 220, 'sine', 0.09, d, { slideTo: up ? 1000 : 450 }), + /** Crossing the finish line. */ + finish: (d: number) => [784, 988, 1318].forEach((f, i) => tone(f, 130, 'triangle', 0.1, d + i * 90)), +}; + const CSS = ` .ma-wrap { width: 100%; max-width: 1100px; display: flex; flex-direction: column; gap: 10px; } /* Taller than the play area on PC: start at the top (centring would cut the top off where nobody can scroll to). */ @@ -42,6 +63,10 @@ const CSS = ` .ma-tok circle { stroke: #1f2937; stroke-width: 2; } .ma-tok.cur circle { stroke: var(--focus); stroke-width: 4; } .ma-tok.trip { opacity: .55; } +.ma-hop { transform-box: fill-box; transform-origin: center; animation: ma-hop .45s ease-out; } +@keyframes ma-hop { 30% { transform: translateY(-10px) scale(1.12); } 60% { transform: translateY(0) scale(.96); } } +.ma-hop.tripped { animation: anim-shake .45s ease both; } +.ma-medal { transform-box: fill-box; transform-origin: center; animation: anim-pop .32s cubic-bezier(.3,1.6,.5,1) both; } .ma-emoji { font-size: 16px; } .ma-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: start; } .ma-panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; } @@ -97,7 +122,7 @@ button.ma-card:hover:not(:disabled) { border-color: var(--primary); } } @media (prefers-reduced-motion: reduce) { .ma-tok { transition: none; } - .ma-die.rolling, .ma-news .fresh { animation: none; } + .ma-die.rolling, .ma-news .fresh, .ma-hop, .ma-medal { animation: none; } } `; @@ -209,12 +234,15 @@ function Track({ v, me, players }: { v: MagicalAthleteView; me: string | null; p const isCur = r.cur === x.id; return ( - - - {RACERS[x.id].emoji} - + {/* Remounted on every move / trip: a hop (or a stumble) while the token slides. */} + + + + {RACERS[x.id].emoji} + + {x.place && ( - + {x.place === 1 ? '๐Ÿฅ‡' : '๐Ÿฅˆ'} )} @@ -293,9 +321,11 @@ function RacePanel({ v, me, players, act, pending, rolling }: { v: MagicalAthlet ))} -

- ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด {pr.timeoutText}. -

+ {v.options.turnSeconds !== null && ( +

+ ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด {pr.timeoutText}. +

+ )} ) : (

@@ -325,7 +355,7 @@ function Draft({ v, me, players, act, pending }: { v: MagicalAthleteView; me: st

{d.line.map((id) => ( -