fix: Correct DOM element IDs for move history and captured pieces #5

Manually merged
Weyoun merged 4 commits from fix/dom-element-id-mismatches into main 2025-11-23 14:46:58 +00:00
Showing only changes of commit 90fcf25dec - Show all commits

View File

@ -223,12 +223,14 @@ class ChessApp {
const captured = this.game.gameState.capturedPieces;
whiteCaptured.innerHTML = captured.black.map(piece =>
`<span class="captured-piece black">${piece.getSymbol()}</span>`
// "Captured by Black" shows white pieces that black captured
whiteCaptured.innerHTML = captured.white.map(piece =>
`<span class="captured-piece white">${piece.getSymbol()}</span>`
).join('') || '-';
blackCaptured.innerHTML = captured.white.map(piece =>
`<span class="captured-piece white">${piece.getSymbol()}</span>`
// "Captured by White" shows black pieces that white captured
blackCaptured.innerHTML = captured.black.map(piece =>
`<span class="captured-piece black">${piece.getSymbol()}</span>`
).join('') || '-';
}