feat: added web view 1v1
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<main class="game-shell">
|
||||
<section class="game-card">
|
||||
<header>
|
||||
<a routerLink="/" class="back-link">Back</a>
|
||||
<h1>1 vs 1 Game</h1>
|
||||
<p class="meta">Game ID: <strong>{{ gameId }}</strong></p>
|
||||
</header>
|
||||
|
||||
@if (loading) {
|
||||
<p>Loading game state...</p>
|
||||
} @else if (state) {
|
||||
<section class="top-section">
|
||||
<div class="state-grid">
|
||||
<div class="panel">
|
||||
<h2>Status</h2>
|
||||
<p>Turn: <strong>{{ state.turn }}</strong></p>
|
||||
<p>Status: <strong>{{ state.status }}</strong></p>
|
||||
<p>FEN:</p>
|
||||
<code>{{ state.fen }}</code>
|
||||
</div>
|
||||
|
||||
<div class="panel">
|
||||
<h2>Moves</h2>
|
||||
<p>PGN: {{ state.pgn || 'No moves yet' }}</p>
|
||||
<p>Played UCI: {{ state.moves.length ? state.moves.join(', ') : 'None' }}</p>
|
||||
<p>Legal UCI: {{ legalMoveUciList.length ? legalMoveUciList.join(', ') : 'None' }}</p>
|
||||
<p>Board: click your piece to highlight legal targets.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class="move-form" (ngSubmit)="submitMove()">
|
||||
<label for="uciMove">Play move (UCI)</label>
|
||||
<input id="uciMove" name="uciMove" [(ngModel)]="moveInput" placeholder="e2e4" />
|
||||
<button type="submit">Send Move</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="board-section">
|
||||
<app-chess-board
|
||||
[fen]="state.fen"
|
||||
[selectedSquare]="selectedSquare"
|
||||
[highlightedSquares]="highlightedSquares"
|
||||
(squareSelected)="onBoardSquareSelected($event)"
|
||||
/>
|
||||
</section>
|
||||
}
|
||||
|
||||
@if (errorMessage) {
|
||||
<p class="error">{{ errorMessage }}</p>
|
||||
}
|
||||
</section>
|
||||
</main>
|
||||
Reference in New Issue
Block a user