Skip to content

Commit

Permalink
Flipped marking opponent to move to viewed player to move when viewin…
Browse files Browse the repository at this point in the history
…g a profile
  • Loading branch information
anoek committed Dec 21, 2023
1 parent 96bfd0b commit eafa7f0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/components/GameList/GameList.styl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
themed background-color miniboard-to-move
}

.opponents-move {
themed background-color miniboard-opponent-to-move
.viewed-users-move {
themed background-color miniboard-viewed-to-move
}

.goban-with-names {
Expand Down
4 changes: 2 additions & 2 deletions src/components/GobanLineSummary/GobanLineSummary.styl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
themed background-color miniboard-to-move;
}

.opponents-move {
themed background-color miniboard-opponent-to-move;
.viewed-users-move {
themed background-color miniboard-viewed-to-move;
}

.game-name, .player {
Expand Down
6 changes: 3 additions & 3 deletions src/components/GobanLineSummary/GobanLineSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export class GobanLineSummary extends React.Component<

// If this is a different player's page, also mark other games
// where it's not that player's move.
opponents_move:
!!player && !is_current_user && user !== player && player_to_move !== player,
viewed_users_move:
!!player && !is_current_user && user !== player && player_to_move === player,
black_to_move_cls: this.goban && black.id === player_to_move ? "to-move" : "",
white_to_move_cls: this.goban && white.id === player_to_move ? "to-move" : "",

Expand Down Expand Up @@ -192,7 +192,7 @@ export class GobanLineSummary extends React.Component<
to={`/game/${this.props.id}`}
className={
`GobanLineSummary ` +
(this.state.opponents_move ? " opponents-move" : "") +
(this.state.viewed_users_move ? " viewed-users-move" : "") +
(this.state.current_users_move ? " current-users-move" : "") +
(this.state.in_stone_removal_phase ? " in-stone-removal-phase" : "")
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/MiniGoban/MiniGoban.styl
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@
themed border-color miniboard-to-move-border
}

.board.opponents-move {
.board.viewed-users-move {
border: 1px solid transparent;
border-radius: 4px;
//padding: 1.2em;
themed background-color miniboard-opponent-to-move;
themed border-color miniboard-opponent-to-move-border
themed background-color miniboard-viewed-to-move;
themed border-color miniboard-viewed-to-move-border
}

.board.in-stone-removal-phase {
Expand Down
8 changes: 4 additions & 4 deletions src/components/MiniGoban/MiniGoban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export function MiniGoban(props: MiniGobanProps): JSX.Element {
const [black_name, setBlackName] = React.useState("");
const [white_name, setWhiteName] = React.useState("");
const [current_users_move, setCurrentUsersMove] = React.useState(false);
const [opponents_move, setOpponentsMove] = React.useState(false);
const [viewed_users_move, setViewedUsersMove] = React.useState(false);
const [black_to_move_cls, setBlackToMoveCls] = React.useState("");
const [white_to_move_cls, setWhiteToMoveCls] = React.useState("");
const [in_stone_removal_phase, setInStoneRemovalPhase] = React.useState(false);
Expand Down Expand Up @@ -229,8 +229,8 @@ export function MiniGoban(props: MiniGobanProps): JSX.Element {
// If this is a different player's page, also mark other games
// where it's not that player's move.
const player = props?.player?.id;
setOpponentsMove(
!!player && !is_current_user && user !== player && player_to_move !== player,
setViewedUsersMove(
!!player && !is_current_user && user !== player && player_to_move === player,
);

setBlackToMoveCls(
Expand Down Expand Up @@ -280,7 +280,7 @@ export function MiniGoban(props: MiniGobanProps): JSX.Element {
className={
"small board" +
(current_users_move ? " current-users-move" : "") +
(opponents_move ? " opponents-move" : "") +
(viewed_users_move ? " viewed-users-move" : "") +
(in_stone_removal_phase ? " in-stone-removal-phase" : "") +
(finished ? " finished" : "")
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export interface GobanInfoStateBase {
white_name?: string;

current_users_move?: boolean;
opponents_move?: boolean;
viewed_users_move?: boolean;
black_to_move_cls?: string;
white_to_move_cls?: string;
in_stone_removal_phase?: boolean;
Expand Down
8 changes: 4 additions & 4 deletions src/ogs.styl
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ light.goban-shadow = 0 4px 8px rgba(128,128,128,.71)
light.goban-shadow-borderless = 0 0px 0px rgba(128,128,128,.71)
light.miniboard-to-move = #E6FFD8
light.miniboard-to-move-border = darken(light.miniboard-to-move, 60%)
light.miniboard-opponent-to-move = #F8F8F8
light.miniboard-opponent-to-move-border = darken(light.miniboard-opponent-to-move, 10%)
light.miniboard-viewed-to-move = #F3F3F3
light.miniboard-viewed-to-move-border = darken(light.miniboard-viewed-to-move, 10%)
light.miniboard-hover = #C7E7E9
light.miniboard-hover-border = darken(light.miniboard-hover, 30%)
light.miniboard-stone-removal = #FBfbD8
Expand Down Expand Up @@ -394,8 +394,8 @@ dark.goban-shadow = none
dark.goban-shadow-borderless = none
dark.miniboard-to-move = #2B4029
dark.miniboard-to-move-border = darken(dark.miniboard-to-move, 60%)
dark.miniboard-opponent-to-move = #282828
dark.miniboard-opponent-to-move-border = lighten(dark.miniboard-opponent-to-move, 10%)
dark.miniboard-viewed-to-move = #282828
dark.miniboard-viewed-to-move-border = lighten(dark.miniboard-viewed-to-move, 10%)
dark.miniboard-hover = #578588
dark.miniboard-hover-border = darken(dark.miniboard-hover, 30%)
dark.miniboard-stone-removal = #5B4810
Expand Down

0 comments on commit eafa7f0

Please sign in to comment.