summaryrefslogtreecommitdiff
path: root/2026/examples/example_teleia/index.html
blob: c548f822b5d8344dd52124b380980c3f8e983e4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
  <head>
    <meta charset="UTF-8">
    <link data-trunk rel="rust" data-wasm-opt="2" data-target-name="game_lib" />
    <!-- <link data-trunk rel="rust" data-keep-debug="true" /> -->
    <base data-trunk-public-url />
    <meta name="theme-color" media="(prefers-color-scheme: light)" content="white">
    <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#404040">
    <link rel="icon" href="data:;base64,iVBORw0KGgo=">
    <link data-trunk rel="css" href="index.css" />
    <title>TODO TITLE</title>
  </head>
  <body>
    <script>
      function send_ready() { window.parent.postMessage({op: "ready"}); }
      function send_started(verb) { window.parent.postMessage({op: "started", verb}); }
      function send_done(win) { window.parent.postMessage({op: "done", win}); }
      addEventListener("message", (ev) => {
          if (ev.data.op == "start") {
              window.wasmBindings.game_start(ev.data.difficulty);
          } else {
              console.log(`unknown message: ${ev.data}`);
          }
      });
      addEventListener("TrunkApplicationStarted", async (event) => {
          console.log("initialized, starting...");
          window.wasmBindings.main_js();
      });
    </script>
    <div id="teleia-parent"></div>
  </body>
</html>