OpenTTD-patches/os/emscripten/shell.html

208 lines
12 KiB
HTML
Raw Normal View History

<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OpenTTD</title>
<style>
body {
font-family: Tahoma, Arial, Helvetica, sans-serif;
font-size: 14px;
margin: 0;
padding: 0;
}
div.background {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAAAhCAIAAAAJYVFIAAASn0lEQVRYw02Xx45lR4JYw0dcf+/zL01ZkkWiOTJQYzYCJAGj/98IkIZsNlnMrHTPXG/ChxbczPmDsznAgT//7w9P9uHH/d+k+DXWP7zIX31wyXSkhxPAzr4c86Ji+wdX307kj3bQO/q9Fg/d9SYunzN3L+m3bpJr/JmhCK+/dY8ipLXvCpT3MbxZmhDKF9/n+VHWzQqxSwY3ltTErojPcPnqZYrE6GW6uKZXXRrupB/jaordcbFDpxpCQAZvRik9q+lSLsYaOnJVlGsk8bCcE6Yz/P2/vtulh6Eeete7jsbrUUQhTFlK7ixpUdYxvxrtBduyntot+3zRD2l4J8G3HN5r/s2cCw10TArFH+C8tyNKt9rNPDBJYRays23TGfW6iVnSgDFxtOFhy4vxOoZFj91IMbckcKK3mCmKOGaamJUOo+qBUTjGW0ilXzwGBHhkvc/5Os6BnJy/rB2WLMP4/b/syf4Pw69SBaqzMOSDG9fpLT88zo+rBN2/6X/m4eNZfWXTyudPpF+77Fk54zoKozks0fbeE58b2MsaTOTC3RGktW2z1lwgX6TZRJnSpANdmUbrdGObgS5mNJpjokR6YXqDTI7L1171KnR+iHkqOc4D1THP4txSGIkcCpqKDB7WK2V0X6thMibo7Y4kCcfFMdakti83hkzRtg9TynTeoD8j9bGF3xJS4qRhvsJxm/K98HtfPA3N/eHGuokPZla070ctQNXLgRRdRd9b9srsAaQNmjPMHJEY86Uk9wvqbfSC5S6BOWQdnAOmKgI3FvUAAmUX30dKQpT1tkuwkH4h7TACF3u0eM1ULWbTDJ06X+d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cakaOY2QqUUvwv9bjFTDj4O8Fykq5IdyJ+DYSqK9r2cgWIhffUa+T73fa4nH6HNw2sPkNkUO0nbmV6YOwhzp+zc+6agR15ITDDhdmqN9TKOcmJ2cRakrBDXdvCTHEz8BGQ+awfjDmk8ThZBRojvF4A//Pd2+mObvHs5PX0Qu8c1/uLLx8R8DwOJV2OQBdk8JPa9ZF8XrRO8buYu3XWZfy/ZozQSRDUDeZsMKLa6oTrMmvVoWJV3ciJ1UAwF8jQ/7LNjVjoGYmkXG3SYiOOnwCY8rDko4kqhIGY1Db4WYR/oWC9GGpkSBoDqXc3ANvXvaTYB44PFwCPKgoiY6zKIO7zZ3U/xi3nZxrsH93pwxZ+J+Z5uH5/eYgcv1yZLignInJodjlvqSxx3ZHy30AdzKjXQJfyk2TfY54ibIIVBcivek7KZTzEaKiWaPC932Y2eTK97M0Keyii1UMUROEJiQNJSHCu7AMfGRcVwK/2IXRrAwkEC6fzXRTAqAm+8pm7MeKYxws47QhkSi9UBJ19u83Uzhh7Xx7Kqks30/Jo6dNFTyeJWpFc6foSe4u2fl1oGcXWnbXy8MnnvslOJ3/HNmaqb+NAzcxsfhtv802l61nV8kQ2BZH8PKExxcXbJm7IG6xhM+ax1Eq/iTataxuRd767E5ZPp/YSRGKCmgA4KDXYkAGngcFGhOBLWGzmayQ0IJJh5p8Mwasta53N89zHG6bCGPzXoAaZvZPguY9SSCx4oTqbE/DCz34nPZ3tFzXYykq97+bQW+4t8LWv7wvWNpN/QfBivRsKmfXWnvv9Pao4OPn1v0XwznJ0Eta1L4zyteuQYkfkULsiUCxgxJiz6a99UHKUROIK4m2Sa54IDNM52wf2oJLSp1taKpozWiGoEKGYQ+oA9w96jYl10PQwAFAVI9U8wYLL7w73t8qIqywgiCP4DWQ7C6ZBmVWg+lh+m3K+Rp7H+bqrtwF70pQyaff99NPw3hvgncPkh6Ahvz77PUTruso
border: 0px none;
display: flex;
height: 100%;
position: absolute;
width: 100%;
z-index: 1;
}
div.overlay {
height: 40px;
margin: 0 auto;
opacity: 0;
pointer-events: none;
position: absolute;
text-align: center;
transition: opacity 0.3s;
width: 100%;
z-index: 3;
}
div.overlay > div {
pointer-events: none;
}
div.background > div, div.overlay > div {
margin: auto;
}
#filesystem {
background-color: #e00000;
border: 1px solid #fc6458;
color: #fcf880;
display: none;
outline: #a00000;
padding: 0 4px;
width: 600px;
}
#title, #message {
background-color: #838383;
border: 1px solid #a8a8a8;
outline: 1px solid #626262;
padding: 0 4px;
min-width: 260px;
}
#box.error #title, #box.error #message {
background-color: #e00000;
border: 1px solid #fc6458;
outline: #a00000;
}
#box.error #message {
color: #fcf880;
}
#title {
color: #fcfcfc;
height: 20px;
text-shadow: 1px 1px #101010;
}
#message {
color: #101010;
height: 54px;
padding: 4px 4px;
}
canvas.emscripten {
border: 0px none;
height: 100%;
position: absolute;
width: 100%;
z-index: 2;
/* OpenTTD draws the cursor itself */
cursor: none !important;
}
</style>
</head>
<body>
<div class="background">
<div id="box">
<div id="title">
Loading ...
</div>
<div id="message">
</div>
</div>
</div>
<div class="overlay" id="overlay">
<div id="filesystem">
Warning: savegames are stored in the Indexed DB of your browser.<br/>Your browser can delete savegames without notice!
</div>
</div>
<div>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
</div>
<script type='text/javascript'>
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
var spinnerElement = document.getElementById('spinner');
var Module = {
preRun: [],
postRun: [],
arguments: [],
totalDependencies: 42,
doneDependencies: 0,
lastDependencies: 1,
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);
return canvas;
})(),
setStatus: function(text) {
var m = text.match(/^([^(]+)\((\d+(\.\d+)?)\/(\d+)\)$/);
if (m) {
text = "(" + m[2] + " / " + m[4] + ") " + m[1];
}
document.getElementById("message").innerHTML = text;
},
monitorRunDependencies: function(left) {
/* If it goes up, a new dependency was added; down means one is
* removed. We only track the latter. */
if (left < Module.lastDependencies) {
Module.doneDependencies += 1;
}
Module.lastDependencies = left;
total = Module.totalDependencies;
doing = Module.doneDependencies + 1;
if (doing > total) {
doing = total;
}
document.getElementById("title").innerHTML = "(" + doing + " / " + total + ") Loading ...";
document.getElementById("message").innerHTML = "Preparing game ...";
},
onExit: function() {
document.getElementById("canvas").style.display = "none";
document.getElementById("title").innerHTML = "Thank you for playing!";
document.getElementById("message").innerHTML = "We hope you enjoyed OpenTTD!<br/><br/>Reload your browser to restart the game.";
},
onAbort: function() {
document.getElementById("canvas").style.display = "none";
document.getElementById("box").className = "error";
document.getElementById("title").innerHTML = "Crash :(";
document.getElementById("message").innerHTML = "The game crashed!<br/><br/>Please reload your browser to restart the game.";
},
onWarningFs: function() {
document.getElementById("filesystem").style.display = "inline-block";
document.getElementById("overlay").style.opacity = 1;
setTimeout(function() {
document.getElementById("overlay").style.opacity = 0;
setTimeout(function() {
document.getElementById("filesystem").style.display = "none";
}, 300);
}, 10000);
}
};
window.onerror = function() {
Module.onAbort();
};
</script>
{{{ SCRIPT }}}
</body>
</html>