mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-12-18 00:23:07 +00:00
d9546d9504
* feat: use synchronous router design * feat: function to get router out of dom * chore: restructure workspace to use renderers as packages, not features
27 lines
684 B
Rust
27 lines
684 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus_tui::launch(app);
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
let radius = use_state(&cx, || 0);
|
|
|
|
cx.render(rsx! {
|
|
div {
|
|
width: "100%",
|
|
height: "100%",
|
|
justify_content: "center",
|
|
align_items: "center",
|
|
background_color: "hsl(248, 53%, 58%)",
|
|
onwheel: move |w| radius.modify(|r| (r + w.delta().strip_units().y as i8).abs()),
|
|
|
|
border_style: "solid none solid double",
|
|
border_width: "thick",
|
|
border_radius: "{radius}px",
|
|
border_color: "#0000FF #FF00FF #FF0000 #00FF00",
|
|
|
|
"{radius}"
|
|
}
|
|
})
|
|
}
|