votes summary improved, message for dead chat

This commit is contained in:
emilis 2026-02-03 02:13:15 +00:00
parent e168bbd9b2
commit 76ac113a8e
No known key found for this signature in database
4 changed files with 46 additions and 10 deletions

View File

@ -3050,6 +3050,17 @@ dialog {
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: baseline; justify-content: baseline;
.id {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: baseline;
}
.votes {
margin-left: 1ch;
}
} }
} }
@ -3061,6 +3072,10 @@ dialog {
font-size: 2em; font-size: 2em;
align-items: center; align-items: center;
.clear {
width: 100%;
}
.mode-buttons { .mode-buttons {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -3101,4 +3116,14 @@ dialog {
flex-direction: column; flex-direction: column;
flex-wrap: nowrap; flex-wrap: nowrap;
align-items: center; align-items: center;
min-width: 5cm;
max-width: 9cm;
overflow-x: hidden;
}
.vote-buttons {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 1ch;
} }

View File

@ -188,7 +188,10 @@ pub fn Client2(ClientProps { auto_join }: &ClientProps) -> Html {
<Signin callback={on_signin} /> <Signin callback={on_signin} />
}, },
ClientEvent2::GameInProgress => html! { ClientEvent2::GameInProgress => html! {
<CoverOfDarkness message={"game in progress".to_string()}/> <div class="game-in-progress">
<h1>{"game in progress"}</h1>
<h3>{"if you're playing, you can come back when dead for dead chat"}</h3>
</div>
}, },
ClientEvent2::Story(story) => html! { ClientEvent2::Story(story) => html! {
<div class="post-game"> <div class="post-game">
@ -196,11 +199,11 @@ pub fn Client2(ClientProps { auto_join }: &ClientProps) -> Html {
</div> </div>
}, },
ClientEvent2::Sleep => html! { ClientEvent2::Sleep => html! {
<CoverOfDarkness /> <CoverOfDarkness message={"cool. come back when dead.".to_string()}/>
}, },
ClientEvent2::Disconnected => html! { ClientEvent2::Disconnected => html! {
<div class="column-list"> <div class="disconnected">
<p>{"disconnected"}</p> <h1>{"disconnected"}</h1>
</div> </div>
}, },
ClientEvent2::Connecting => { ClientEvent2::Connecting => {

View File

@ -623,7 +623,6 @@ impl Component for Host {
} }
_ => None, _ => None,
}; };
log::info!("voting mode button: {}", voting_mode_btn.is_some());
let nav = self.big_screen.not().then(|| { let nav = self.big_screen.not().then(|| {
html! { html! {
<nav class="host-nav" style="z-index: 3;"> <nav class="host-nav" style="z-index: 3;">

View File

@ -87,18 +87,27 @@ pub fn VotingMode(VotingModeProps { characters }: &VotingModeProps) -> Html {
.map(|(c, v)| { .map(|(c, v)| {
html! { html! {
<li> <li>
<IdentitySpan ident={c.identity.clone().into_public()}/> <span class="id"><IdentitySpan ident={c.identity.clone().into_public()}/>{":"}</span>
{": "} <span class="votes"><span class="red">{*v}</span>{" votes"}</span>
{*v}
{" votes"}
</li> </li>
} }
}) })
.collect::<Html>(); .collect::<Html>();
let on_clear = {
let votes = votes.clone();
move |_| {
let mut v = (*votes).clone();
for (_, v) in v.iter_mut() {
*v = 0;
}
votes.set(v);
}
};
html! { html! {
<div class="character-picker"> <div class="character-picker">
<div class="top-of-day-info"> <div class="top-of-day-info">
<div class="voting-mode"> <div class="voting-mode">
<Button classes={classes!("clear")} on_click={on_clear}>{"clear votes"}</Button>
<span class="red">{"voting mode"}</span> <span class="red">{"voting mode"}</span>
<div class="mode-buttons"> <div class="mode-buttons">
<Button classes={classes!(add)} on_click={set_add}>{"add"}</Button> <Button classes={classes!(add)} on_click={set_add}>{"add"}</Button>
@ -106,7 +115,7 @@ pub fn VotingMode(VotingModeProps { characters }: &VotingModeProps) -> Html {
</div> </div>
</div> </div>
</div> </div>
<div class="player-list"> <div class="vote-buttons">
{buttons} {buttons}
</div> </div>
<ol class="vote-summary"> <ol class="vote-summary">