Skip to content

Commit ff8fc22

Browse files
committed
Tune mobile animation pacing and stabilize clock label
1 parent 84d2ef3 commit ff8fc22

3 files changed

Lines changed: 33 additions & 33 deletions

File tree

src/GameContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ export function GameProvider({ children }: { children: ReactNode }) {
258258
const speed = store.settings.animationSpeed;
259259
const thinkDelays =
260260
speed === "very-slow"
261-
? { slide: 1650, teleport: 3800 }
261+
? { slide: 2300, teleport: 6200 }
262262
: speed === "slow"
263-
? { slide: 1200, teleport: 2900 }
264-
: { slide: 900, teleport: 2200 };
263+
? { slide: 1600, teleport: 4800 }
264+
: { slide: 1200, teleport: 3700 };
265265
const minThinkMs = prevMove?.isPortalEntry ? thinkDelays.teleport : thinkDelays.slide;
266266
const t0 = performance.now();
267267
const move = await chooseBotMove(state, lvl, { allowExternal: mode.kind === "bot" });

src/components/Clock.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useGame } from "../GameContext";
33
const TIMER_OPTIONS = [0, 10, 30, 60, 120] as const;
44

55
export function Clock() {
6-
const { timeLeft, state, isBotThinking, store, players, updateSetting } = useGame();
6+
const { timeLeft, state, store, players, updateSetting } = useGame();
77
const current = store.settings.timerSeconds;
88
const off = current === 0;
99
const secs = off || !isFinite(timeLeft) ? null : Math.max(0, timeLeft);
@@ -34,7 +34,7 @@ export function Clock() {
3434
{renderBadge(state.turn === "w")}
3535
</div>
3636
<div className={`clock-side ${state.turn === "b" ? "active" : ""}`}>
37-
<span>{players.b} {isBotThinking ? "(thinking…)" : ""}</span>
37+
<span>{players.b}</span>
3838
{renderBadge(state.turn === "b")}
3939
</div>
4040
</div>

src/styles.css

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,53 @@
1010
--legal-capture: rgba(239, 68, 68, 0.65);
1111
--selected: rgba(250, 204, 21, 0.55);
1212
--last: rgba(250, 204, 21, 0.25);
13-
--anim-slide-ms: 700ms;
14-
--anim-demat-ms: 900ms;
15-
--anim-remat-ms: 900ms;
16-
--anim-remat-delay-ms: 1100ms;
13+
--anim-slide-ms: 900ms;
14+
--anim-demat-ms: 1300ms;
15+
--anim-remat-ms: 1300ms;
16+
--anim-remat-delay-ms: 1700ms;
1717
}
1818

1919
.board.anim-speed-normal {
20-
--anim-slide-ms: 700ms;
21-
--anim-demat-ms: 900ms;
22-
--anim-remat-ms: 900ms;
23-
--anim-remat-delay-ms: 1100ms;
20+
--anim-slide-ms: 900ms;
21+
--anim-demat-ms: 1300ms;
22+
--anim-remat-ms: 1300ms;
23+
--anim-remat-delay-ms: 1700ms;
2424
}
2525

2626
.board.anim-speed-slow {
27-
--anim-slide-ms: 900ms;
28-
--anim-demat-ms: 1100ms;
29-
--anim-remat-ms: 1100ms;
30-
--anim-remat-delay-ms: 1400ms;
27+
--anim-slide-ms: 1200ms;
28+
--anim-demat-ms: 1700ms;
29+
--anim-remat-ms: 1700ms;
30+
--anim-remat-delay-ms: 2200ms;
3131
}
3232

3333
.board.anim-speed-very-slow {
34-
--anim-slide-ms: 1200ms;
35-
--anim-demat-ms: 1500ms;
36-
--anim-remat-ms: 1500ms;
37-
--anim-remat-delay-ms: 1900ms;
34+
--anim-slide-ms: 1700ms;
35+
--anim-demat-ms: 2300ms;
36+
--anim-remat-ms: 2300ms;
37+
--anim-remat-delay-ms: 3000ms;
3838
}
3939

4040
@media (max-width: 640px) {
4141
.board.anim-speed-normal {
42-
--anim-slide-ms: 900ms;
43-
--anim-demat-ms: 1100ms;
44-
--anim-remat-ms: 1100ms;
45-
--anim-remat-delay-ms: 1400ms;
42+
--anim-slide-ms: 1100ms;
43+
--anim-demat-ms: 1500ms;
44+
--anim-remat-ms: 1500ms;
45+
--anim-remat-delay-ms: 2000ms;
4646
}
4747

4848
.board.anim-speed-slow {
49-
--anim-slide-ms: 1100ms;
50-
--anim-demat-ms: 1300ms;
51-
--anim-remat-ms: 1300ms;
52-
--anim-remat-delay-ms: 1700ms;
49+
--anim-slide-ms: 1500ms;
50+
--anim-demat-ms: 2000ms;
51+
--anim-remat-ms: 2000ms;
52+
--anim-remat-delay-ms: 2600ms;
5353
}
5454

5555
.board.anim-speed-very-slow {
56-
--anim-slide-ms: 1450ms;
57-
--anim-demat-ms: 1800ms;
58-
--anim-remat-ms: 1800ms;
59-
--anim-remat-delay-ms: 2200ms;
56+
--anim-slide-ms: 2100ms;
57+
--anim-demat-ms: 2600ms;
58+
--anim-remat-ms: 2600ms;
59+
--anim-remat-delay-ms: 3400ms;
6060
}
6161
}
6262

0 commit comments

Comments
 (0)