weather.rs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //! basic example that renders a simple VNode 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. wasm_bindgen_futures::spawn_local(WebsysRenderer::start(|cx| {
  11. cx.render(html! {
  12. <div>
  13. <div class="flex items-center justify-center flex-col">
  14. <div class="flex items-center justify-center">
  15. <div class="flex flex-col bg-white rounded p-4 w-full max-w-xs">
  16. // Title
  17. <div class="font-bold text-xl">
  18. "Jon's awesome site!!"
  19. </div>
  20. // Subtext / description
  21. <div class="text-sm text-gray-500">
  22. "He worked so hard on it :)"
  23. </div>
  24. <div class="flex flex-row items-center justify-center mt-6">
  25. // Main number
  26. <div class="font-medium text-6xl">
  27. "1337"
  28. </div>
  29. </div>
  30. // Try another
  31. <div class="flex flex-row justify-between mt-6">
  32. // <a href=format!("http://localhost:8080/fib/{}", other_fib_to_try) class="underline">
  33. "Legit made my own React"
  34. // </a>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. })
  41. }));
  42. }