Files
mcpe/platforms/sdl/emscripten/wasm_shell.html
2023-11-01 21:48:41 -04:00

56 lines
2.0 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ReMinecraftPE</title>
<style>
html, body {
background-color: black;
width: 100%;
height: 100%;
margin: 0;
overflow: hidden;
}
canvas {
display: block;
border: 0px none;
}
</style>
</head>
<body>
<canvas id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
<script type="text/javascript" src="coi-serviceworker.min.js"></script>
<script type='text/javascript'>
var Module = {
print: function (text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.log(text);
},
printErr: function (text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
},
canvas: (function () {
var canvas = document.getElementById('canvas');
// As a default initial behavior, pop up an alert when webgl context is lost. To make your
// application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
// Handle Resize
function setCanvasSize() {
Module.ccall('resize_from_js', null, ['number', 'number'], [window.innerWidth, window.innerHeight]);
}
window.addEventListener("resize", setCanvasSize);
return canvas;
})(),
arguments: [String(window.innerWidth), String(window.innerHeight)]
};
</script>
<script async type="text/javascript" src="reminecraftpe.js"></script>
</body>
</html>