Update
[anarch.git] / HTMLshell.html
blob9b589a55e666ec7fd84c5274a1c16e45317f8821
1 <!doctype html>
3 <!--
4 HTML template for the emscripted page. Unlike emscipten's official minimal
5 frontend, this one is really minimal.
7 by Miloslav Ciz (drummyfish), 2020
9 Released under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/)
10 plus a waiver of all other intellectual property. The goal of this work is
11 be and remain completely in the public domain forever, available for any use
12 whatsoever.
13 -->
15 <html>
17 <head>
18 <meta charset="utf-8">
19 <title>game</title>
21 <style>
22 table
24 width: 100%;
29 width: 11%;
30 padding: 0;
31 margin: 0;
34 button
36 width: 100%;
39 canvas
41 display: block;
42 margin: 10px auto 30px;
44 </style>
45 </head>
47 <body>
48 <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
50 <script type='text/javascript'>
51 Module = {
52 print:
53 function(what)
55 console.log(what);
57 printErr:
58 function(what)
60 console.error(what);
62 canvas:
64 function()
66 return document.getElementById('canvas');
68 )(),
69 onRuntimeInitialized: function()
71 pressFunc = Module.cwrap('webButton', '', ['number','number']);
75 function down(button)
77 pressFunc(button,1);
80 function up(button)
82 pressFunc(button,0);
84 </script>
86 {{{ SCRIPT }}}
88 <table style="user-select:none; -moz-user-select: none; -ms-user-select:none; -webkit-user-select: none; -o-user-select:none;" onselectstart="return false;" unselectable="on">
89 <tr> <td></td> <td><button onmousedown="down(0)" ontouchstart="down(0)" onmouseup="up(0)" ontouchend="up(0)" onmouseout="up(0)" ontouchleave="(0)">U</button></td> <td></td> <td></td> <td><button onmousedown="down(4)" ontouchstart="down(4)" onmouseup="up(4)" ontouchend="up(4)" onmouseout="up(4)" ontouchleave="(4)">A</button></td> <td></td> <td></td> </tr>
90 <tr> <td><button onmousedown="down(3)" ontouchstart="down(3)" onmouseup="up(3)" ontouchend="up(3)" onmouseout="up(3)" ontouchleave="(3)">L</button></td> <td></td> <td><button onmousedown="down(1)" ontouchstart="down(1)" onmouseup="up(1)" ontouchend="up(1)" onmouseout="up(1)" ontouchleave="(1)">R</button></td> <td></td> <td></td> <td><button onmousedown="down(5)" ontouchstart="down(5)" onmouseup="up(5)" ontouchend="up(5)" onmouseout="up(5)" ontouchleave="(5)">B</button></td> <td></td> </tr>
91 <tr> <td></td> <td><button onmousedown="down(2)" ontouchstart="down(2)" onmouseup="up(2)" ontouchend="up(2)" onmouseout="up(2)" ontouchleave="(2)">D</button></td> <td></td> <td></td> <td></td> <td></td> <td><button onmousedown="down(6)" ontouchstart="down(6)" onmouseup="up(6)" ontouchend="up(6)" onmouseout="up(6)" ontouchleave="(6)">C</button></td> </tr>
92 </table>
94 </body>
95 </html>