2023-05-02 14:38:58 +00:00
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2022-01-01 04:53:37 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
fn main() {
|
2024-01-19 22:19:49 +00:00
|
|
|
dioxus_tui::launch_cfg(app, Default::default());
|
2023-05-02 14:38:58 +00:00
|
|
|
}
|
|
|
|
|
2024-01-19 22:19:49 +00:00
|
|
|
#[component]
|
|
|
|
fn Quadrant(color: String, text: String) -> Element {
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2023-05-02 14:38:58 +00:00
|
|
|
div {
|
|
|
|
border_width: "1px",
|
|
|
|
width: "50%",
|
|
|
|
height: "100%",
|
|
|
|
justify_content: "center",
|
|
|
|
align_items: "center",
|
2024-01-19 22:19:49 +00:00
|
|
|
background_color: "{color}",
|
|
|
|
"{text}"
|
2023-05-02 14:38:58 +00:00
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-01-01 04:53:37 +00:00
|
|
|
}
|
|
|
|
|
2024-01-14 04:51:37 +00:00
|
|
|
fn app() -> Element {
|
2024-01-14 05:12:21 +00:00
|
|
|
rsx! {
|
2022-01-01 04:53:37 +00:00
|
|
|
div {
|
|
|
|
width: "100%",
|
|
|
|
height: "100%",
|
|
|
|
flex_direction: "column",
|
|
|
|
div {
|
|
|
|
width: "100%",
|
|
|
|
height: "50%",
|
|
|
|
flex_direction: "row",
|
2024-01-19 22:19:49 +00:00
|
|
|
Quadrant {
|
2023-05-02 14:38:58 +00:00
|
|
|
color: "red".to_string(),
|
|
|
|
text: "[A]".to_string()
|
|
|
|
},
|
2024-01-19 22:19:49 +00:00
|
|
|
Quadrant {
|
2023-05-02 14:38:58 +00:00
|
|
|
color: "black".to_string(),
|
|
|
|
text: "[B]".to_string()
|
2022-01-01 04:53:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
div {
|
|
|
|
width: "100%",
|
|
|
|
height: "50%",
|
|
|
|
flex_direction: "row",
|
2024-01-19 22:19:49 +00:00
|
|
|
Quadrant {
|
2023-05-02 14:38:58 +00:00
|
|
|
color: "green".to_string(),
|
|
|
|
text: "[C]".to_string()
|
|
|
|
},
|
2024-01-19 22:19:49 +00:00
|
|
|
Quadrant {
|
2023-05-02 14:38:58 +00:00
|
|
|
color: "blue".to_string(),
|
|
|
|
text: "[D]".to_string()
|
2022-01-01 04:53:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-01-14 05:12:21 +00:00
|
|
|
}
|
2022-01-01 04:53:37 +00:00
|
|
|
}
|