fix(web): browser game UX pass — shake feedback, timer, stock count, HUD

- game.js fully rewritten: correct coordinate system (PAD baked into
  PILE_ORIGIN), undo driven by undo_stack_len, flashIllegal shake with
  --card-tx CSS variable, game timer, stock count HUD, URL seed persist,
  foundation suit hints, auto-complete step loop
- game.html: adds hud-timer, hud-stock, win-time elements
- game.css: @keyframes illegal-shake, .slot-hint, overflow-x on main
- solitaire_wasm: adds undo_stack_len to GameSnapshot

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-13 10:27:05 -07:00
parent 1e6d153cd0
commit 0ebe87a411
5 changed files with 225 additions and 218 deletions
+3
View File
@@ -234,6 +234,8 @@ pub struct GameSnapshot {
pub is_won: bool,
pub is_auto_completable: bool,
pub undo_count: u32,
/// Number of snapshots currently on the undo stack; 0 means undo is unavailable.
pub undo_stack_len: usize,
pub stock: Vec<CardSnapshot>,
pub waste: Vec<CardSnapshot>,
pub foundations: [Vec<CardSnapshot>; 4],
@@ -275,6 +277,7 @@ impl SolitaireGame {
is_won: self.game.is_won,
is_auto_completable: self.game.is_auto_completable,
undo_count: self.game.undo_count,
undo_stack_len: self.game.undo_stack_len(),
stock: cards(PileType::Stock),
waste: cards(PileType::Waste),
foundations: [