Migrate to SDL2 and deploy as WASM
All checks were successful
Build & deploy web version / Build WebAssembly & deploy (push) Successful in 1m8s
All checks were successful
Build & deploy web version / Build WebAssembly & deploy (push) Successful in 1m8s
This commit is contained in:
parent
81f4f20899
commit
c9b542eccf
1 changed files with 1411 additions and 483 deletions
66
web/shell.html
Normal file
66
web/shell.html
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<!doctype html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Platform játék</title>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
background: #1a0505;
|
||||
color: #e8d5d5;
|
||||
font: 16px/1.5 system-ui, sans-serif;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#shell {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: none;
|
||||
background: #280000;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#status {
|
||||
position: fixed;
|
||||
bottom: 12px;
|
||||
font-size: 14px;
|
||||
opacity: 0.65;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="shell">
|
||||
<canvas id="canvas" tabindex="-1" oncontextmenu="event.preventDefault()"></canvas>
|
||||
</div>
|
||||
<div id="status">Betöltés…</div>
|
||||
<script>
|
||||
var statusElement = document.getElementById('status');
|
||||
var canvasElement = document.getElementById('canvas');
|
||||
|
||||
var Module = {
|
||||
canvas: canvasElement,
|
||||
preRun: [],
|
||||
postRun: [],
|
||||
print: function (text) { console.log(text); },
|
||||
printErr: function (text) { console.error(text); },
|
||||
setStatus: function (text) {
|
||||
if (text) statusElement.textContent = text;
|
||||
}
|
||||
};
|
||||
|
||||
canvasElement.addEventListener('click', function () { canvasElement.focus(); });
|
||||
window.addEventListener('keydown', function (event) {
|
||||
if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].indexOf(event.key) >= 0) event.preventDefault();
|
||||
});
|
||||
</script>
|
||||
{{{ SCRIPT }}}
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue