Commit 4f492cea authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: show chess pieces (remove font-size:0) + correct Stockfish API endpoint /api/chess/move

Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent e5ba646d
......@@ -61,7 +61,7 @@ switch ($action) {
$wtime = $input['wtime'] ?? 60000;
$btime = $input['btime'] ?? 60000;
$apiUrl = STOCKFISH_API . '/play';
$apiUrl = STOCKFISH_API . '/api/chess/move';
$payload = json_encode([
'bot_id' => $botId,
'fen' => $fen,
......@@ -85,7 +85,7 @@ switch ($action) {
if ($httpCode === 200) {
$data = json_decode($response, true);
echo json_encode(['move' => $data['move'] ?? null]);
echo json_encode(['move' => $data['best_move'] ?? null]);
} else {
http_response_code(502);
echo json_encode(['error' => 'bot_unavailable', 'status' => $httpCode]);
......
......@@ -119,13 +119,15 @@
.piece {
width: 85%;
height: 85%;
font-size: 0;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
font-size: calc(min(10vw, 56px));
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: grab;
z-index: 1;
transition: transform 0.15s var(--ease);
transition: transform 0.15s ease;
user-select: none;
}
.piece:active { cursor: grabbing; }
......@@ -136,18 +138,6 @@
transform: scale(1.1);
}
/* Piece images via CSS classes - using unicode */
.piece-wK::before, .piece-wQ::before, .piece-wR::before,
.piece-wB::before, .piece-wN::before, .piece-wP::before,
.piece-bK::before, .piece-bQ::before, .piece-bR::before,
.piece-bB::before, .piece-bN::before, .piece-bP::before {
font-size: calc(min(10vw, 56px));
line-height: 1;
}
.piece-wK { content: ''; }
.piece-bK { content: ''; }
/* Coordinate labels */
.board-coords-file, .board-coords-rank {
position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment