Skip to content

Commit

Permalink
Merge pull request #30 from Chia-Network/20240910-keep-blockchain
Browse files Browse the repository at this point in the history
Add labels and styling for end cards
  • Loading branch information
prozacchiwawa authored Sep 10, 2024
2 parents 8b2c87e + d831713 commit 73f7bdf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 12 additions & 0 deletions resources/web/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,15 @@ body {
.winner-0 {
color: #333;
}

#card-choices-end-label {
margin-top: 0.25em;
font-size: 1.1em;
font-weight: 900;
}

#other-choices-end-label {
margin-top: 0.25em;
font-size: 1.1em;
font-weight: 900;
}
10 changes: 7 additions & 3 deletions resources/web/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class PlayerController {
this.take_auto_action(json);
}

return `<h2>You must generate a secret value and send a hash commitment</h2><div>${button}"`;
return `<h2>You must generate a secret value and send a hash commitment</h2><div>${button}`;
}

after_word(json) {
Expand Down Expand Up @@ -172,12 +172,16 @@ class PlayerController {
let result;

if (typeof(json.readable) !== 'string' && json.readable.raw_alice_selects) {
result = `<h2>Game outcome</h2><div>${game_outcome(this.player_id, json, json.known_cards)}</div><div id='card-choices'></div><div id='opponent-choices'></div>`;
result = `<h2>Game outcome</h2><div>${game_outcome(this.player_id, json, json.known_cards)}</div><div id='card-choices-end-label'>Your cards</div><div id='card-choices'></div><div id='other-choices-end-label'>Their cards</div><div id='opponent-choices'></div>`;
} else {
result = '<h2>Waiting for game outcome</h2>';
}

return [result, json.known_cards];
if (this.player_id == 1) {
return [result, json.known_cards];
} else {
return [result, [json.known_cards[1], json.known_cards[0]]];
};
}


Expand Down

0 comments on commit 73f7bdf

Please sign in to comment.