Compare commits

..

No commits in common. "191ae2113cd1753b465d02ab223ac32535d7dea7" and "b1ace6ceb3a1db013d83f5b06242197284145947" have entirely different histories.

4 changed files with 3 additions and 32 deletions

View file

@ -25,5 +25,3 @@ pipeline:
github_sshkey
target_branch: gh-pages
pages_directory: ./lib/static
when:
branch: main

View file

@ -94,7 +94,7 @@ export function App()
`Player ${Constants.PLAYER_NAMES[game.winner]} wins!` :
`It's player "${Constants.PLAYER_NAMES[game.currentPlayer]}"s turn`
],
[MenuBar, { game }]
[MenuBar]
];
}
@ -153,13 +153,10 @@ export function Field({ field })
/**
* Renders a menu bar.
*
* @param {{ game: Game }} game
* The game to represent.
*
* @returns {NodeDescriptor}
* The rendered element.
*/
export function MenuBar({ game })
export function MenuBar()
{
return [
"div",
@ -167,18 +164,7 @@ export function MenuBar({ game })
[Button, { content: ["New Game", { className: newGameClass }] }],
[Button, { content: ["Save Game", { className: saveGameClass }] }],
[Button, { content: ["Load Game", { className: loadGameClass }] }],
[
Button,
{
content: [
"Undo Last Move",
{
className: undoClass,
...(game.undoStackCount > 0 ? {} : { disabled: true })
}
]
}
]
[Button, { content: ["Undo Last Move", { className: undoClass }] }]
];
}

View file

@ -68,14 +68,6 @@ export class Game
return this.state.turnCount % 2 === 0 ? "r" : "b";
}
/**
* Gets the number of entries in the undo stack.
*/
get undoStackCount()
{
return this.#previousStates.length;
}
/**
* Gets the id of the player that is winning.
*

View file

@ -19,11 +19,6 @@ button:active {
background-color: rgb(96, 190, 221);
}
button:disabled {
background-color: whitesmoke;
border-color: lightgray;
}
div {
box-sizing: border-box;
}