Update more examples, add css for more examples

This commit is contained in:
Jonathan Kelley committed 2024-02-14 13:48:58 -08:00
1 parent 60b78668ac
commit cfc119cce2
19 files changed
+228 -101

No files matched your search

+9 -5
View File
@@ -15,12 +15,16 @@ fn app() -> Element {
let mut state = use_signal(|| PlayerState { is_playing: false });
rsx!(
div {
h1 {"Select an option"}
h3 { "The radio is... ", {state.read().is_playing()}, "!" }
button { onclick: move |_| state.write().reduce(PlayerAction::Pause), "Pause" }
button { onclick: move |_| state.write().reduce(PlayerAction::Play), "Play" }
style { {include_str!("./assets/radio.css")} }
h1 {"Select an option"}
// Add some cute animations if the radio is playing!
div { class: if state.read().is_playing { "bounce" },
"The radio is... ", {state.read().is_playing()}, "!"
}
button { id: "play", onclick: move |_| state.write().reduce(PlayerAction::Pause), "Pause" }
button { id: "pause", onclick: move |_| state.write().reduce(PlayerAction::Play), "Play" }
)
}