diff --git a/werewolves/index.scss b/werewolves/index.scss index 6036aea..e1b1deb 100644 --- a/werewolves/index.scss +++ b/werewolves/index.scss @@ -2195,6 +2195,11 @@ li.choice { color: hsl(280, 65%, 43%); } } + + .redir-url { + user-select: text; + color: rgba(255, 255, 255, 0.7); + } } .footer { @@ -2210,3 +2215,7 @@ li.choice { padding: 10px 0 10px 0; border-top: 1px solid white; } + +.has-confirm { + cursor: pointer; +} diff --git a/werewolves/src/components/client/footer.rs b/werewolves/src/components/client/footer.rs index 080b712..6982aba 100644 --- a/werewolves/src/components/client/footer.rs +++ b/werewolves/src/components/client/footer.rs @@ -57,26 +57,30 @@ pub fn ClientFooter() -> Html { #[function_component] pub fn About() -> Html { - let confirm_state = use_state(|| false); + let source_confirm_state = use_state(|| false); + let git_ref_confirm_state = use_state(|| false); + let source_code_confirm = { let confirm_callback = { move |_| { let _ = gloo::utils::window().location().set_href(SOURCE_CODE_URL); } }; - let message = html! { + let confirm_message = html! { <>

{"this will take you away from the game"}

+
{"("}{SOURCE_CODE_URL}{")"}

{"make sure this isn't an oopsie"}

}; + html! { - {"source code"} + } }; @@ -86,16 +90,43 @@ pub fn About() -> Html { {"(dirty)"} }); + let git_ref_confirm = { + let git_ref_url = format!("{SOURCE_CODE_URL}/commit/{}", crate::BUILD_ID_LONG); + let confirm_callback = { + let git_ref_url = git_ref_url.clone(); + move |_| { + let _ = gloo::utils::window().location().set_href(&git_ref_url); + } + }; + let confirm_message = html! { + <> +

{"this will take you away from the game"}

+

{"("}{git_ref_url}{")"}

+

{"make sure this isn't an oopsie"}

+ + }; + + html! { + + + {crate::BUILD_ID} + {dirty} + + + } + }; + html! {

{"werewolves"}

- - {crate::BUILD_ID} - {dirty} - + {git_ref_confirm}

diff --git a/werewolves/src/components/dialog.rs b/werewolves/src/components/dialog.rs index 1b4d860..c1d8d45 100644 --- a/werewolves/src/components/dialog.rs +++ b/werewolves/src/components/dialog.rs @@ -132,7 +132,7 @@ pub fn WithConfirmation( }; html! { <> - + {children.clone()} {confirmation_dialog} }