2021-06-01 18:33:15 -04:00
|
|
|
//! Basic example that renders a simple VNode to the browser.
|
2021-05-15 12:03:08 -04:00
|
|
|
|
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
use dioxus_core::prelude::*;
|
2021-07-07 18:17:00 -04:00
|
|
|
use dioxus_html as dioxus_elements;
|
2021-05-15 12:03:08 -04:00
|
|
|
use dioxus_web::*;
|
2021-07-07 13:51:55 -04:00
|
|
|
|
2021-05-15 12:03:08 -04:00
|
|
|
fn main() {
|
|
|
|
// Setup logging
|
2021-06-22 17:20:54 -04:00
|
|
|
// wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
|
2021-05-15 12:03:08 -04:00
|
|
|
console_error_panic_hook::set_once();
|
|
|
|
// Run the app
|
|
|
|
wasm_bindgen_futures::spawn_local(WebsysRenderer::start(App));
|
|
|
|
}
|
|
|
|
|
2021-06-25 21:15:33 -04:00
|
|
|
static App: FC<()> = |cx| {
|
2021-07-07 16:19:10 -04:00
|
|
|
let (contents, set_contents) = use_state_classic(cx, || "asd");
|
2021-05-15 12:03:08 -04:00
|
|
|
|
2021-06-25 21:15:33 -04:00
|
|
|
cx.render(rsx! {
|
2021-05-15 12:03:08 -04:00
|
|
|
div {
|
|
|
|
class: "flex items-center justify-center flex-col"
|
|
|
|
div {
|
|
|
|
class: "flex items-center justify-center"
|
|
|
|
div {
|
|
|
|
class: "flex flex-col bg-white rounded p-4 w-full max-w-xs"
|
|
|
|
div { class: "font-bold text-xl", "Example cloud app" }
|
|
|
|
div { class: "text-sm text-gray-500", "This is running in the cloud!!" }
|
|
|
|
div {
|
|
|
|
class: "flex flex-row items-center justify-center mt-6"
|
|
|
|
div { class: "font-medium text-6xl", "100%" }
|
|
|
|
}
|
|
|
|
div {
|
|
|
|
class: "flex flex-row justify-between mt-6"
|
|
|
|
a {
|
|
|
|
href: "https://www.dioxuslabs.com"
|
|
|
|
class: "underline"
|
|
|
|
"Made with dioxus"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
};
|