summaryrefslogtreecommitdiff
path: root/templates/api
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-02-18 02:16:42 -0500
committerLLLL Colonq <llll@colonq>2025-02-18 02:16:42 -0500
commit34b49df0ab7336789e79590e51d4456f92024408 (patch)
treeafb48cf4b8225f4aad720625e25ddbb02faec462 /templates/api
parent40e23e661765c9eae506efc3308be1b053deda4a (diff)
Fix aspect ratio
Diffstat (limited to 'templates/api')
-rw-r--r--templates/api/throwshade.html18
1 files changed, 14 insertions, 4 deletions
diff --git a/templates/api/throwshade.html b/templates/api/throwshade.html
index 2bf006a..d65add6 100644
--- a/templates/api/throwshade.html
+++ b/templates/api/throwshade.html
@@ -16,6 +16,16 @@ CONFIG_SUBST
window.wasmBindings = bindings;
console.log("initialized, starting...");
window.wasmBindings.main_js();
+ function resizeCanvas() {
+ let canvas = document.getElementById("teleia-parent").firstChild;
+ if (canvas) {
+ canvas.width = 1920;
+ canvas.height = 1080;
+ } else {
+ setTimeout(resizeCanvas, 50);
+ }
+ }
+ resizeCanvas();
</script>
<script type="module" src="./main.js"></script>
</head>
@@ -24,10 +34,10 @@ CONFIG_SUBST
<div id="lcolonq-throwshade-bottom">
<div id="lcolonq-throwshade-bottom-left">
<textarea id="lcolonq-throwshade-textarea">
-vec4 shade(vec2 cs) {
- return vec4(0.0, 1.0, 0.0, 1.0);
-}
-</textarea>
+ vec4 shade(vec2 cs) {
+ return vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ </textarea>
</div>
<div id="lcolonq-throwshade-bottom-right">
<img id="lcolonq-throwshade-button-test" src="./assets/test.gif"></img>