diff options
| author | LLLL Colonq <llll@colonq> | 2026-06-18 16:15:46 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-06-18 16:15:46 -0400 |
| commit | c9fc2ca532c5219a087924ece1e38be19c25f006 (patch) | |
| tree | 7c9d8e32617fab6e6179fe70893a3027714ea4e7 /2026/examples/example_teleia/index.html | |
| parent | 068f3b9dc0522b03af534479cfa300a720ae86fa (diff) | |
Update
Diffstat (limited to '2026/examples/example_teleia/index.html')
| -rw-r--r-- | 2026/examples/example_teleia/index.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/2026/examples/example_teleia/index.html b/2026/examples/example_teleia/index.html new file mode 100644 index 0000000..c548f82 --- /dev/null +++ b/2026/examples/example_teleia/index.html @@ -0,0 +1,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> |
