diff --git a/werewolves-proto/src/game/settings.rs b/werewolves-proto/src/game/settings.rs index 78602a0..fef0b3d 100644 --- a/werewolves-proto/src/game/settings.rs +++ b/werewolves-proto/src/game/settings.rs @@ -231,15 +231,7 @@ impl GameSettings { } pub fn min_players_needed(&self) -> usize { - let (wolves, villagers) = (self.wolves_count(), self.village_roles_count()); - - if wolves > villagers { - wolves + 1 + wolves - } else if wolves < villagers { - wolves + villagers - } else { - wolves + villagers + 1 - } + (2 * self.wolves_count() + 1).max(3) } pub fn new_slot(&mut self, role: RoleTitle) -> SlotId { diff --git a/werewolves/index.scss b/werewolves/index.scss index e1b1deb..809f5ac 100644 --- a/werewolves/index.scss +++ b/werewolves/index.scss @@ -81,8 +81,8 @@ body { body { min-height: 100vh; max-width: 100vw; - top: 0; - left: 0; + top: 0px; + left: 0px; font-size: 1.5vh; user-select: none; @@ -174,7 +174,10 @@ nav.host-nav { } .lobby-player-list { + overflow: hidden; padding-bottom: 80px; + flex-shrink: 1; + display: flex; flex-direction: row; flex-wrap: wrap; @@ -334,23 +337,29 @@ button { &:disabled:hover::after { content: attr(reason); + overflow-y: hidden; position: absolute; - margin-top: 10px; - top: 90%; - // left: 0; + margin-top: 100px; + min-width: 20vw; font: 'Cute Font'; - // color: #000; - // background-color: #fff; color: rgba(255, 0, 0, 1); - background-color: rgba(255, 0, 0, 0.3); + background-color: black; border: 1px solid rgba(255, 0, 0, 0.3); - min-width: 50vw; - width: fit-content; padding: 3px; z-index: 4; + align-self: center; + justify-self: center; } } +.host-setup { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + font-family: 'Cute Font'; + font-size: 1.5em; + overflow-y: hidden; +} .settings { list-style: none; @@ -369,6 +378,15 @@ button { padding: 0px; font-size: 0.7em; } + + .settings-info { + display: flex; + flex-direction: column; + flex-wrap: nowrap; + gap: 5px; + text-align: left; + width: fit-content; + } } .wolves-intro { @@ -822,7 +840,7 @@ clients { .client-nav { max-width: 100%; padding: 10px; - height: 37px; + height: 38px; display: flex; flex-direction: row; justify-content: baseline; @@ -2219,3 +2237,7 @@ li.choice { .has-confirm { cursor: pointer; } + +.dimmed { + filter: opacity(70%); +} diff --git a/werewolves/src/clients/host/host.rs b/werewolves/src/clients/host/host.rs index 71faad7..46f122f 100644 --- a/werewolves/src/clients/host/host.rs +++ b/werewolves/src/clients/host/host.rs @@ -467,7 +467,7 @@ impl Component for Host { let _ = loc.replace("/"); } }); - let screen = if self.big_screen { + let screen = self.big_screen.then_some({ let to_normal = Callback::from(|_| { if let Some(loc) = gloo::utils::document().location() { let _ = loc.replace("/host"); @@ -476,20 +476,7 @@ impl Component for Host { html! { } - } else { - // let to_big = Callback::from(|_| { - // if let Some(loc) = gloo::utils::document().location() { - // let _ = loc.replace("/host/big"); - // } - // }); - html! { - - - - } - }; + }); let story_on_click = if let HostState::Story { .. } = &self.state { crate::callback::send_message(HostMessage::GetState, self.send.clone()) } else { @@ -765,7 +752,7 @@ impl Host { }) }); html! { -
{format!("Players in lobby: {}", players.len())}
-{format!("min roles for setup: {}", settings.min_players_needed())}
-{format!("current role count: {}", settings.slots().len())}
+