summaryrefslogtreecommitdiff
path: root/2026/index.html
diff options
context:
space:
mode:
Diffstat (limited to '2026/index.html')
-rw-r--r--2026/index.html30
1 files changed, 17 insertions, 13 deletions
diff --git a/2026/index.html b/2026/index.html
index d7cfe98..ce28e45 100644
--- a/2026/index.html
+++ b/2026/index.html
@@ -11,9 +11,6 @@
width: 100vw;
height: 100vh;
}
- .jam-transparent {
- visibility: hidden;
- }
#jam-iframe-parent {
display: grid;
grid-template-columns: 100%;
@@ -31,7 +28,7 @@
padding: 0px;
border: 0px;
}
- #jam-iframe {
+ #jam-game-iframe {
}
#jam-framing-iframe {
z-index: 1;
@@ -39,20 +36,29 @@
</style>
</head>
<body>
- <!-- <div id="jam-cover"> -->
- <!-- it's in between games -->
- <!-- </div> -->
- <!-- <iframe id="jam-iframe" width="240" height="160" src="./game.html"></iframe> -->
<div id="jam-iframe-parent">
<iframe id="jam-framing-iframe" width="480" height="320" src="./framing/dist/index.html"></iframe>
- <iframe id="jam-iframe" width="240" height="160" src="./examples/godot/output/game.html"></iframe>
+ <!-- <iframe id="jam-game-iframe" width="240" height="160" src="./examples/godot/output/game.html"></iframe> -->
+ <iframe id="jam-game-iframe" width="240" height="160" src="game.html"></iframe>
<div>
<script type="module">
- let iframe = document.getElementById("jam-iframe");
+ let iframe = document.getElementById("jam-game-iframe");
iframe.addEventListener("load", () => {
iframe.contentDocument.body.style["overflow"] = "hidden";
iframe.contentDocument.body.style["image-rendering"] = "pixelated";
});
+ function resizeView() {
+ let least_ratio = Math.min(Math.floor(window.innerWidth / 480), Math.floor(window.innerHeight / 320));
+ let factor = Math.max(1, least_ratio);
+ console.log(factor);
+ let game = document.getElementById("jam-game-iframe");
+ game.style["transform"] = `scale(${factor})`;
+ console.log(game.style.transform);
+ let framing = document.getElementById("jam-framing-iframe");
+ framing.style["transform"] = `scale(${factor})`;
+ }
+ resizeView();
+ window.addEventListener("resize", resizeView);
window.addEventListener("message", ev => {
console.log(ev.data);
switch (ev.data.op) {
@@ -64,13 +70,11 @@
}, 1000);
break;
case "started":
- // document.getElementById("jam-cover").classList.add("jam-transparent");
iframe.contentWindow.focus();
break;
case "done":
- // document.getElementById("jam-cover").classList.remove("jam-transparent");
break;
- default: console.log(`unknown event: {ev}`); break;
+ default: console.log(`unknown event: ${ev}`); break;
}
});
</script>