1
0

landingpage2.rs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //! Basic example that renders a simple VNode to the browser.
  2. use dioxus_core::prelude::*;
  3. use dioxus_html_namespace as dioxus_elements;
  4. use dioxus_web::*;
  5. fn main() {
  6. // Setup logging and panic handling
  7. wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
  8. console_error_panic_hook::set_once();
  9. // Run the app
  10. wasm_bindgen_futures::spawn_local(WebsysRenderer::start(App));
  11. }
  12. static App: FC<()> = |cx| {
  13. let (contents, set_contents) = use_state_classic(cx, || "asd");
  14. cx.render(rsx! {
  15. div { class: "flex items-center justify-center flex-col"
  16. div { class: "flex items-center justify-center"
  17. div { class: "flex flex-col bg-white rounded p-4 w-full max-w-xs"
  18. div { class: "font-bold text-xl", "Example Web app" }
  19. div { class: "text-sm text-gray-500", "This is running in your browser!" }
  20. div { class: "flex flex-row items-center justify-center mt-6"
  21. div { class: "font-medium text-6xl", "100%" }
  22. }
  23. div { class: "flex flex-row justify-between mt-6"
  24. a { href: "https://www.dioxuslabs.com", class: "underline"
  25. "Made with dioxus"
  26. }
  27. }
  28. }
  29. }
  30. }
  31. })
  32. };