diff options
Diffstat (limited to '2026/index.html')
| -rw-r--r-- | 2026/index.html | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/2026/index.html b/2026/index.html index 0ea10c8..3216c75 100644 --- a/2026/index.html +++ b/2026/index.html @@ -1,18 +1,9 @@ <!DOCTYPE html> <html lang="en"> - <script type="module"> - window.microgames = [ - {url: "./examples/raylib/output/index.html", loaded: null, ready: false}, - // {url: "./games/bytomancer/index.html", loaded: null, ready: false}, - {url: "./games/mrrobust/index.html", loaded: null, ready: false}, - {url: "./examples/teleia/dist/index.html", loaded: null, ready: false}, - {url: "./examples/godot/output/index.html", loaded: null, ready: false}, - {url: "./examples/js/index.html", loaded: null, ready: false}, - ]; - </script> <head> <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"> + <script type="module" src="./games.js"></script> <title>Jam Framing Test</title> <style> body { @@ -66,6 +57,7 @@ <iframe id="jam-framing-iframe" width="480" height="320" src="./framing/dist/index.html"></iframe> </div> <script type="module"> + let microgames = window.MICROGAMES.map(g => ({url: g, loaded: null, ready: false})); let framing = document.getElementById("jam-framing-iframe"); let microgame_index = 0; let waiting_to_start = null; @@ -88,14 +80,6 @@ } framing.style["transform"] = `scale(${factor})`; } - resizeView(); - window.addEventListener("resize", resizeView); - for (let i of iframes) { - i.addEventListener("load", () => { - i.contentDocument.body.style["overflow"] = "hidden"; - i.contentDocument.body.style["image-rendering"] = "pixelated"; - }); - } function loadGame(i) { if (!microgames[i].loaded) { @@ -150,6 +134,15 @@ } } + resizeView(); + window.addEventListener("resize", resizeView); + for (let i of iframes) { + i.addEventListener("load", () => { + i.contentDocument.body.style["overflow"] = "hidden"; + i.contentDocument.body.style["image-rendering"] = "pixelated"; + }); + } + window.addEventListener("message", ev => { console.log(`received message: ${ev.data.op}`); switch (ev.data.op) { |
