Files
kubeinvaders/js-web/KubeInvaders/index.html
Eugenio Marzo 84942c3c8c fix 0.2 version
2019-04-20 18:18:56 +02:00

153 lines
3.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>KubeInvaders 0.2</title>
<style>
/* Disable user selection to avoid strange bug in Chrome on Windows:
* Selecting a text outside the canvas, then clicking+draging would
* drag the selected text but block mouse down/up events to the engine.
*/
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* DEF-3413
* The Facebook container will be populated with the Facebook SDK content
* when a Facebook App Id is provided in game.project.
* This caused problems with selections in Chrome on Windows, just like
* above. Explicitly disabling selection on the root div fixes the issue.
*/
.fb-root {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.canvas-app-container {
background: rgb(255,255,255) no-repeat center url("try_game.png");
/* A positioned parent for loading visuals */
position: relative;
}
.canvas-app-container:-webkit-full-screen {
/* Auto width and height in Safari/Chrome fullscreen. */
width: auto;
height: auto;
}
.canvas-app-canvas {
max-height: 100vh;
max-width: 100%;
}
.canvas-app-progress {
position: absolute;
background-color: rgb(245, 245, 245);
height: 20px;
/* Progress same width as canvas. */
width: 1280px;
bottom: 0px;
}
.canvas-app-progress-bar {
font-size: 12px;
height: 20px;
color: rgb(255, 255, 255);
background-color: rgb(30, 100, 234);
text-align: center;
line-height: 20px;
}
.button {
color: #fff;
background-color: #1e64ea;
border-color: transparent;
padding: 10px 20px;
}
</style>
</head>
<body>
<div id="fb-root" class="fb-root"></div>
<div id="app-container" class="canvas-app-container">
<canvas id="canvas" class="canvas-app-canvas" tabindex="1" width="1280" height="720"></canvas>
</div>
<button id="fullscreen" class="button">Fullscreen</button>
<!-- -->
<script type='text/javascript' src="dmloader.js"></script>
<!-- -->
<script type='text/javascript'>
var extra_params = {
archive_location_filter: function( path ) {
return ("archive" + path + "");
},
splash_image: "splash_image.png",
custom_heap_size: 268435456,
disable_context_menu: true
}
Module['onRuntimeInitialized'] = function() {
Module.runApp("canvas", extra_params);
};
Module["locateFile"] = function(path, scriptDirectory)
{
// dmengine*.wasm is hardcoded in the built JS loader for WASM,
// we need to replace it here with the correct project name.
if (path == "dmengine.wasm" || path == "dmengine_release.wasm" || path == "dmengine_headless.wasm") {
path = "KubeInvaders.wasm";
}
return scriptDirectory + path;
};
function load_engine() {
var engineJS = document.createElement('script');
engineJS.type = 'text/javascript';
if (Module['isWASMSupported']) {
engineJS.src = 'KubeInvaders_wasm.js';
} else {
engineJS.src = 'KubeInvaders_asmjs.js';
}
document.head.appendChild(engineJS);
}
/* Fullscreen button */
document.getElementById("fullscreen").onclick = function (e) {
Module.toggleFullscreen();
};
if (false) {
// Load Facebook API
var fb = document.createElement('script');
fb.type = 'text/javascript';
fb.src = '//connect.facebook.net/en_US/sdk.js';
fb.onload = load_engine;
document.head.appendChild(fb);
} else {
load_engine();
}
</script>
</body>
</html>