1
0

index.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/name.js";
  13. init("/./assets/dioxus/name_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/dioxus/tree/master/packages/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. })()
  43. </script>