fix: Correct DOM element IDs for move history and captured pieces #5
10
js/main.js
10
js/main.js
@ -223,12 +223,14 @@ class ChessApp {
|
|||||||
|
|
||||||
const captured = this.game.gameState.capturedPieces;
|
const captured = this.game.gameState.capturedPieces;
|
||||||
|
|
||||||
whiteCaptured.innerHTML = captured.black.map(piece =>
|
// "Captured by Black" shows white pieces that black captured
|
||||||
`<span class="captured-piece black">${piece.getSymbol()}</span>`
|
whiteCaptured.innerHTML = captured.white.map(piece =>
|
||||||
|
`<span class="captured-piece white">${piece.getSymbol()}</span>`
|
||||||
).join('') || '-';
|
).join('') || '-';
|
||||||
|
|
||||||
blackCaptured.innerHTML = captured.white.map(piece =>
|
// "Captured by White" shows black pieces that white captured
|
||||||
`<span class="captured-piece white">${piece.getSymbol()}</span>`
|
blackCaptured.innerHTML = captured.black.map(piece =>
|
||||||
|
`<span class="captured-piece black">${piece.getSymbol()}</span>`
|
||||||
).join('') || '-';
|
).join('') || '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user