feat(wasm): playable browser game at /play

Add `SolitaireGame` WASM binding to `solitaire_wasm` exposing draw(),
move_cards(), undo(), auto_complete_step(), and state() — all backed by
the real solitaire_core rules engine.

Add /play route to solitaire_server serving a full vanilla-JS
interactive Klondike game (game.html / game.css / game.js). Features:
drag-and-drop card moves (mouse + touch via PointerEvents), click stock
to draw, double-click card to auto-move to foundation, undo, draw-1/3
toggle, new game, auto-complete animation, win overlay, seed display.
Rebuild solitaire_wasm.js + solitaire_wasm_bg.wasm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-13 09:42:56 -07:00
parent af5ac68947
commit 1e6d153cd0
7 changed files with 1158 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solitaire Quest — Play</title>
<link rel="stylesheet" href="/web/game.css">
</head>
<body>
<header>
<div class="hud-left">
<span class="logo">Solitaire Quest</span>
<span id="hud-seed" class="muted"></span>
</div>
<div class="hud-center">
<span id="hud-score">Score: 0</span>
<span id="hud-moves">Moves: 0</span>
</div>
<div class="hud-right">
<button id="btn-undo" title="Undo (Z)">↩ Undo</button>
<button id="btn-new" title="New game">↺ New</button>
<label class="toggle-label" title="Draw one or three cards">
<input type="checkbox" id="chk-draw3"> Draw 3
</label>
</div>
</header>
<main>
<section id="board"></section>
</main>
<div id="win-overlay" class="hidden">
<div class="win-card">
<div class="win-title">You Won!</div>
<div id="win-score" class="win-score"></div>
<div id="win-moves" class="win-detail"></div>
<button id="btn-win-new">Play Again ↺</button>
</div>
</div>
<script type="module" src="/web/game.js"></script>
</body>
</html>