aboutsummaryrefslogtreecommitdiff
path: root/ems
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-10-12 00:23:57 +1100
committerquou <quou@disroot.org>2024-10-12 00:24:07 +1100
commit7a7628a3feaec81d9a445acbec604baecac3a167 (patch)
tree962d56698071cdf5766083b77fa05607b9e37668 /ems
parentc5445eb3032f2081c8cf798e03b088b64b016a1f (diff)
sdl + emscripten backend
Diffstat (limited to 'ems')
-rw-r--r--ems/post_run.js3
-rw-r--r--ems/template.html48
2 files changed, 51 insertions, 0 deletions
diff --git a/ems/post_run.js b/ems/post_run.js
new file mode 100644
index 0000000..b52a931
--- /dev/null
+++ b/ems/post_run.js
@@ -0,0 +1,3 @@
+addOnPostRun(function() {
+ document.getElementById('canvas').focus();
+});
diff --git a/ems/template.html b/ems/template.html
new file mode 100644
index 0000000..10694e2
--- /dev/null
+++ b/ems/template.html
@@ -0,0 +1,48 @@
+<!doctype html>
+<html lang="en-us">
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <title>hftrss</title>
+
+ <style>
+ body {
+ padding: none;
+ margin-top: 0px;
+ margin-left: 0px;
+ background-color: #000000;
+ image-rendering: crisp-edges;
+ }
+ </style>
+ </head>
+ <body>
+ <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex="0" onclick="focus_canvas()"></canvas>
+
+ <script>
+ function focus_canvas() {
+ document.getElementById('canvas').focus();
+ }
+ Module = {
+ print:
+ function(what)
+ {
+ console.log(what);
+ },
+ printErr:
+ function(what)
+ {
+ console.error(what);
+ },
+ canvas:
+ (
+ function()
+ {
+ return document.getElementById('canvas');
+ }
+ )()
+ };
+ </script>
+
+ {{{ SCRIPT }}}
+ </body>
+</html>