1
0

tui_border.rs 669 B

123456789101112131415161718192021222324252627
  1. use dioxus::prelude::*;
  2. fn main() {
  3. dioxus::tui::launch(app);
  4. }
  5. fn app(cx: Scope) -> Element {
  6. let radius = use_state(&cx, || 0);
  7. cx.render(rsx! {
  8. div {
  9. width: "100%",
  10. height: "100%",
  11. justify_content: "center",
  12. align_items: "center",
  13. background_color: "hsl(248, 53%, 58%)",
  14. onwheel: move |w| radius.modify(|r| (r + w.delta_y as i8).abs()),
  15. border_style: "solid none solid double",
  16. border_width: "thick",
  17. border_radius: "{radius}px",
  18. border_color: "#0000FF #FF00FF #FF0000 #00FF00",
  19. "{radius}"
  20. }
  21. })
  22. }