weather.rs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //! basic example that renders a simple domtree to the page :)
  2. //!
  3. //!
  4. //!
  5. use dioxus_core::prelude::*;
  6. use dioxus_web::*;
  7. fn main() {
  8. wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
  9. console_error_panic_hook::set_once();
  10. // todo: wire up the component macro macro
  11. // div! { class = "asd" onclick = move |_| {}
  12. // div! { class = "asd" onclick = move |_| {} }
  13. // h1! { "123456" "123456" "123456" }
  14. // h2! { "123456" "123456" "123456" }
  15. // h3! { "123456" "123456" "123456" }
  16. // };
  17. WebsysRenderer::simple_render(html! {
  18. <div>
  19. <div class="flex items-center justify-center flex-col">
  20. <div class="flex items-center justify-center">
  21. <div class="flex flex-col bg-white rounded p-4 w-full max-w-xs">
  22. // Title
  23. <div class="font-bold text-xl">
  24. "Jon's awesome site!!11"
  25. </div>
  26. // Subtext / description
  27. <div class="text-sm text-gray-500">
  28. "He worked so hard on it :)"
  29. </div>
  30. <div class="flex flex-row items-center justify-center mt-6">
  31. // Main number
  32. <div class="font-medium text-6xl">
  33. "1337"
  34. </div>
  35. </div>
  36. // Try another
  37. <div class="flex flex-row justify-between mt-6">
  38. // <a href=format!("http://localhost:8080/fib/{}", other_fib_to_try) class="underline">
  39. "Legit made my own React"
  40. // </a>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. });
  47. }