Skip to content

Commit 26432ed

Browse files
committed
Portal warp: tighten to 2.0s total (demat 900ms + 200ms gap + remat 900ms)
1 parent b07d3fc commit 26432ed

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/GameContext.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,10 @@ export function GameProvider({ children }: { children: ReactNode }) {
245245
try {
246246
// Compute the bot move and ensure enough time has elapsed so the
247247
// human's own animation has time to play before the board re-renders
248-
// with the bot's response. Teleport animations are longer (~2.8s
249-
// total: demat + gap + remat) so we wait extra when the previous
250-
// move was a portal entry. Slide animation is ~650ms, so we wait
251-
// ~750ms after a normal human move.
248+
// with the bot's response. Teleport animation is 2.0s total
249+
// (demat + gap + remat). Slide animation is ~650ms.
252250
const prevMove = state.history[state.history.length - 1];
253-
const minThinkMs = prevMove?.isPortalEntry ? 2900 : 750;
251+
const minThinkMs = prevMove?.isPortalEntry ? 2100 : 750;
254252
const t0 = performance.now();
255253
const move = await chooseBotMove(state, lvl);
256254
const elapsed = performance.now() - t0;

src/styles.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,17 @@ section label { display: block; margin: 6px 0; }
278278
will-change: transform;
279279
}
280280
/* Portal teleport: piece dematerialises at origin, rematerialises at destination.
281-
Total warp duration: demat (1300ms) + gap (200ms) + remat (1300ms) = ~2.8s. */
281+
Total warp duration: demat (900ms) + gap (200ms) + remat (900ms) = 2.0s. */
282282
.piece-dematerialize {
283283
position: absolute;
284284
inset: 0;
285285
pointer-events: none;
286-
animation: piece-demat 1300ms ease-in forwards;
286+
animation: piece-demat 900ms ease-in forwards;
287287
will-change: transform, opacity, filter;
288288
z-index: 2;
289289
}
290290
.piece-rematerialize {
291-
animation: piece-remat 1300ms 1500ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
291+
animation: piece-remat 900ms 1100ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
292292
will-change: transform, opacity, filter;
293293
}
294294
@keyframes piece-demat {

0 commit comments

Comments
 (0)