some fine tuning

This commit is contained in:
2024-11-22 12:42:03 +01:00
parent 7f1437e779
commit 129725dce2
5 changed files with 22 additions and 30 deletions
+2 -25
View File
@@ -1,29 +1,6 @@
use osui::prelude::*;
pub struct App {}
use osui::examples;
fn main() {
while osui::run(&mut app()) {}
}
fn app() -> Element {
rsx! { styling: Some(styles()),
button { class: "btn", on_click: Handler::new(|_, _, document| {
if let Some(txt) = document.get_element_by_id::<Text>("txt") {
txt.children.set_text("edited");
}
}), "Hello, World!" }
text { id: "txt", y: 2, "Some text!" }
}
}
fn styles() -> Css {
css! {
.btn: clicked {
color: Blue
}
.btn: hover {
color: Red
}
}
while osui::run(&mut examples::event_logger()) {}
}