Skip to content

Commit

Permalink
More comprehensible
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Sep 10, 2024
1 parent 6790118 commit 468ad2a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
25 changes: 25 additions & 0 deletions resources/web/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,28 @@ body {
.player_info-true {
height: 4rem;
}

.outcome-heading {
font-weight: 900;
font-size: 1.5rem;
}

#outcome-line-1 {
font-size: 1.2rem;
}

#outcome-line-2 {
font-size: 1.2rem;
}

.winner--1 {
color: green;
}

.winner-1 {
color: red;
}

.winner-0 {
color: #333;
}
4 changes: 2 additions & 2 deletions resources/web/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ function game_outcome(player_id, json, cards) {
hand_cards.push(cards[1][i]);
}

card_outcome = `<div>Your hand ${describe_hand(json.readable[hand_desc], cards)}</div><div>Opponent hand ${describe_hand(json.readable[oppo_desc])}</div>`;
card_outcome = `<div id='outcome-line-1'>Your hand ${describe_hand(json.readable[hand_desc], cards)}</div><div id='outcome-line-2'>Opponent hand ${describe_hand(json.readable[oppo_desc])}</div>`;
}

return `${winner_text}${card_outcome}`;
return `<div class='outcome-heading winner-${winner}'>${winner_text}</div>${card_outcome}`;
}

function allow_manual_move(player_id, json) {
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ fn main() {
let rt = tokio::runtime::Runtime::new().unwrap();

rt.block_on(async {
let auto = args_vec.iter().any(|x| x == "auto");
let mut auto = args_vec.iter().any(|x| x == "auto");

let router = Router::new()
.get(index)
Expand All @@ -1014,9 +1014,9 @@ fn main() {
let acceptor = TcpListener::new("127.0.0.1:5800").bind().await;

let s = std::thread::spawn(move || {
if auto {
{
let mut locked = MUTEX.lock().unwrap();
(*locked).set_auto(true);
(*locked).set_auto(auto);
}

loop {
Expand Down

0 comments on commit 468ad2a

Please sign in to comment.