index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>dioxus | ⛺</title>
  5. <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <meta charset="UTF-8" />
  8. </head>
  9. <body>
  10. <div id="main"></div>
  11. <script type="module">
  12. import init from "/./assets/dioxus/dioxus.js";
  13. init("/./assets/dioxus/dioxus_bg.wasm").then(wasm => {
  14. if (wasm.__wbindgen_start == undefined) {
  15. wasm.main();
  16. }
  17. });
  18. </script>
  19. </body>
  20. </html><script>// Dioxus-CLI
  21. // https://github.com/DioxusLabs/cli
  22. (function () {
  23. var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
  24. var url = protocol + '//' + window.location.host + '/_dioxus/ws';
  25. var poll_interval = 8080;
  26. var reload_upon_connect = () => {
  27. window.setTimeout(
  28. () => {
  29. var ws = new WebSocket(url);
  30. ws.onopen = () => window.location.reload();
  31. ws.onclose = reload_upon_connect;
  32. },
  33. poll_interval);
  34. };
  35. var ws = new WebSocket(url);
  36. ws.onmessage = (ev) => {
  37. if (ev.data == "reload") {
  38. window.location.reload();
  39. }
  40. };
  41. ws.onclose = reload_upon_connect;
  42. })()</script>