On a phone, a reveal scrolls to what happened
The result strip comes into view with the last two ledger rows above it, so the revealed gestures and their outcome are the first thing seen. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
3716f49bbb
commit
0036eaf625
@@ -1,5 +1,6 @@
|
||||
// Reactive wrapper around the engine for a duel of one person against the bot.
|
||||
|
||||
import { tick } from 'svelte';
|
||||
import { chooseBotTurn } from './bot';
|
||||
import {
|
||||
completableIn,
|
||||
@@ -618,6 +619,14 @@ export class Duel {
|
||||
if (pinned && this.planned.some((p) => p.hand === h && p.completion.spell.id === pinned)) this.pins[h] = null;
|
||||
}
|
||||
this.resetDrafts();
|
||||
// On a phone the hands sit far below the ledger; bring the result into view.
|
||||
if (this.compact) {
|
||||
void tick().then(() => {
|
||||
const target = document.getElementById(this.state.over ? 'verdict' : 'turn-result');
|
||||
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
target?.scrollIntoView({ behavior: reduce ? 'auto' : 'smooth', block: 'start' });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private resetDrafts(): void {
|
||||
|
||||
Reference in New Issue
Block a user