Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function PlayerBar({ color }: Props) {
const headers = game.getHeaders();
const name = headers[color];
const opponent = color === 'w' ? 'b' : 'w';

const isActive = !game.isGameOver() && game.turn() === color;
const captures = takenPieces(game).filter((p) => p.color === color);

// Temporary array of captures, we will do this properly later.
Expand All @@ -69,7 +69,7 @@ export default function PlayerBar({ color }: Props) {
}

return (
<div className={styles.playerBar} data-player={color}>
<div className={styles.playerBar} data-active={isActive} data-player={color}>
<div className={`${styles.player} squiggle-border`}>
<div className={`grid-pile ${styles.logo}`}>
<img src={pieceColorImages[color]} alt="" width="64" height="64" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@
position: relative;
line-height: 1.3;
min-height: 40px;
transition: background-color 0.2s ease;

:global([data-reduced-motion]) & {
transition: none;
}

[data-active="true"] & {
background-color: #bdeeff;
}

[data-player="b"] & {
padding-left: 2em;
Expand Down