SpaceCadetPinball/SpaceCadetPinball/emscripten_shell.html

324 lines
13 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>3D Pinball for Windows - Space Cadet</title>
<style>
/* Based on https://tpenguinltg.github.io/winclassic/ */
:root {
--ActiveBorder: rgb(212, 208, 200);
--ActiveTitle: rgb(10, 36, 106);
--AppWorkspace: rgb(128, 128, 128);
--Background: rgb(58, 110, 165);
--ButtonAlternateFace: rgb(192, 192, 192);
--ButtonDkShadow: rgb(64, 64, 64);
--ButtonFace: rgb(212, 208, 200);
--ButtonHilight: rgb(255, 255, 255);
--ButtonLight: rgb(212, 208, 200);
--ButtonShadow: rgb(128, 128, 128);
--ButtonText: rgb(0, 0, 0);
--GradientActiveTitle: rgb(166, 202, 240);
--GradientInactiveTitle: rgb(192, 192, 192);
--GrayText: rgb(128, 128, 128);
--Hilight: rgb(10, 36, 106);
--HilightText: rgb(255, 255, 255);
--HotTrackingColor: rgb(0, 0, 128);
--InactiveBorder: rgb(212, 208, 200);
--InactiveTitle: rgb(128, 128, 128);
--InactiveTitleText: rgb(212, 208, 200);
--InfoText: rgb(0, 0, 0);
--InfoWindow: rgb(255, 255, 225);
--Menu: rgb(212, 208, 200);
--MenuBar: rgb(192, 192, 192);
--MenuHilight: rgb(0, 0, 128);
--MenuText: rgb(0, 0, 0);
--Scrollbar: rgb(212, 208, 200);
--TitleText: rgb(255, 255, 255);
--Window: rgb(255, 255, 255);
--WindowFrame: rgb(0, 0, 0);
--WindowText: rgb(0, 0, 0);
}
body {
font-family: Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--Background);
text-align: center;
}
textarea.emscripten {
font-family: monospace;
width: 80%;
}
canvas.emscripten {
border: 0px none;
background-color: black;
}
.titlebar {
text-align: start;
margin: 0px;
padding: 1px;
position: relative;
overflow: hidden;
display: flex;
user-select: none;
}
.titlebar .titlebar-icon {
width: 16px;
height: 16px;
padding: 1px;
}
.titlebar .titlebar-title {
display: flex;
padding: 0px 2px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
flex-grow: 1;
font-weight: bold;
align-items: center;
}
.titlebar .titlebar-wincontrols {
display: inline-block;
margin: 0px;
padding: 1px;
min-width: fit-content;
}
.titlebar-wincontrols .buttons-wrapper {
display: inline-block;
width: auto;
margin: 0px;
padding: 1px;
}
.titlebar-wincontrols .spacer {
display: inline-block;
margin: 0px;
padding: 0px;
width: 2px;
}
.titlebar-wincontrols .button {
display: inline-block;
min-width: 12px;
min-height: 10px;
width: 12px;
height: 10px;
text-align: center;
vertical-align: middle;
line-height: 10px;
}
.window {
font-size: 8pt;
color: var(--WindowText);
background-color: var(--ButtonFace);
border: 1px solid var(--ActiveBorder);
box-shadow: -0.5px -0.5px 0px 0.5px var(--ButtonHilight), 0px 0px 0px 1px var(--ButtonShadow), -0.5px -0.5px 0px 1.5px var(--ButtonLight), 0px 0px 0px 2px var(--ButtonDkShadow);
padding-right: 0;
margin-left: auto;
margin-right: auto;
display: inline-block;
}
.window.active {
border: 1px solid var(--ActiveBorder);
}
.window.active .titlebar .titlebar-icon {
background-color: var(--ActiveTitle);
color: var(--TitleText);
}
.window.active .titlebar .titlebar-title {
background-color: var(--ActiveTitle);
background-image: linear-gradient(to right, var(--ActiveTitle), var(--GradientActiveTitle));
color: var(--TitleText);
}
.window.active .titlebar .titlebar-wincontrols,
.window.active .titlebar .titlebar-wincontrols .buttons-wrapper {
background-color: var(--GradientActiveTitle);
font-size: 8pt;
font-weight: bold;
}
.button {
margin: 2px;
}
.button span.button-content {
display: inline-block;
}
.button:active .button-content {
transform: translate(1px, 1px);
}
.button {
background-color: var(--ButtonFace);
color: var(--ButtonText);
box-shadow: -0.5px -0.5px 0px 0.5px var(--ButtonLight), 0px 0px 0px 1px var(--ButtonShadow), -0.5px -0.5px 0px 1.5px var(--ButtonHilight), 0px 0px 0px 2px var(--ButtonDkShadow);
}
.button:active {
box-shadow: -0.5px -0.5px 0px 0.5px var(--ButtonShadow), 0px 0px 0px 1px var(--ButtonShadow), -0.5px -0.5px 0px 1.5px var(--WindowFrame), 0px 0px 0px 2px var(--WindowFrame);
}
.button svg path {
fill: var(--ButtonText);
}
.titlebar .button:active {
box-shadow: -0.5px -0.5px 0px 0.5px var(--ButtonShadow), 0px 0px 0px 1px var(--ButtonLight), -0.5px -0.5px 0px 1.5px var(--ButtonDkShadow), 0px 0px 0px 2px var(--ButtonHilight);
}
#status {
margin: 40px 32px;
}
</style>
</head>
<body>
<div class="window active">
<div class="titlebar">
<span class="titlebar-title">3D Pinball for Windows - Space Cadet</span>
<div class="titlebar-wincontrols">
<ul class="buttons-wrapper">
<li class="button minimize">
<svg xmlns="http://www.w3.org/2000/svg" width="0.125017in" height="0.104181in"
viewBox="0 0 12 10" class="button-content replaced-svg">
<path id="Minimize" fill="black" stroke="black" stroke-width="0"
d="M 2.00,7.00 C 2.00,7.00 8.00,7.00 8.00,7.00 8.00,7.00 8.00,9.00 8.00,9.00 8.00,9.00 2.00,9.00 2.00,9.00 2.00,9.00 2.00,7.00 2.00,7.00 Z">
</path>
</svg>
</li>
<li class="button maximize">
<svg xmlns="http://www.w3.org/2000/svg" width="0.125017in" height="0.104181in"
viewBox="0 0 12 10" class="button-content replaced-svg">
<path id="Maximize" fill="black" stroke="black" stroke-width="0"
d="M 2.00,2.00 C 2.00,2.00 9.00,2.00 9.00,2.00 9.00,2.00 9.00,8.00 9.00,8.00 9.00,8.00 2.00,8.00 2.00,8.00 2.00,8.00 2.00,2.00 2.00,2.00 Z M 1.00,0.00 C 1.00,0.00 1.00,9.00 1.00,9.00 1.00,9.00 10.00,9.00 10.00,9.00 10.00,9.00 10.00,0.00 10.00,0.00 10.00,0.00 1.00,0.00 1.00,0.00 Z">
</path>
</svg>
</li>
<li class="spacer"></li>
<li class="button close">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1"
width="12" height="10" class="button-content replaced-svg">
<g transform="translate(0,-1042.3622)" id="layer1">
<path
d="m 2.0025485,1043.3853 2.0198115,0 0,1.0185 0.984011,0 0,0.984 1.985286,0 0,-0.984 1.001274,0 0,-1.0185 2.002548,0 0,1.0013 0,0 0,0 -1.001274,0 0,1.0012 -1.001274,0 0,0.9841 -1.001274,0 0,1.0012 1.001274,0 0,1.0013 1.001274,0 0,1.0013 1.001274,0 0,1.0013 -2.002548,0 0,-1.0013 -1.001274,0 0,-0.984 -1.985286,0 0,0.984 -1.001274,0 0,1.0013 -2.0025485,0 0,-1.0013 1.0012745,0 0,-1.0013 1.001274,0 0,-1.0013 1.001274,0 0,-1.0012 -1.001274,0 0,-0.9841 -1.001274,0 0,-1.0012 -1.0012745,0 0,-1.0186 z"
id="Close" fill="black" stroke-width="0"></path>
</g>
</svg>
</li>
</ul>
</div>
</div>
<div class="emscripten" id="status">Downloading...</div>
<div class="emscripten">
<progress value="0" max="100" id="progress" hidden=1></progress>
</div>
<canvas class="emscripten" id="canvas" style="display:none;" oncontextmenu="event.preventDefault()"
tabindex="-1"></canvas>
</div>
<!--<textarea class="emscripten" id="output" rows="8"></textarea>-->
<script type='text/javascript'>
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
var Module = {
preRun: [],
postRun: [],
print: (function () {
var element = document.getElementById('output');
if (element) element.value = ''; // clear browser cache
return function (text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&amp;");
//text = text.replace(/</g, "&lt;");
//text = text.replace(/>/g, "&gt;");
//text = text.replace('\n', '<br>', 'g');
console.log(text);
/*if (element) {
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
}*/
};
})(),
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) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.last.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Module.setStatus.last.time < 30) return; // if this is a progress update, skip it if too soon
Module.setStatus.last.time = now;
Module.setStatus.last.text = text;
if (m) {
text = m[1];
progressElement.value = parseInt(m[2]) * 100;
progressElement.max = parseInt(m[4]) * 100;
progressElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
var canvas = document.getElementById('canvas');
canvas.style.display = "";
}
statusElement.innerHTML = text;
if (text === "") {
statusElement.style.display = "none";
progressElement.style.display = "none";
} else {
statusElement.style.display = "";
progressElement.style.display = "";
}
},
totalDependencies: 0,
monitorRunDependencies: function (left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies - left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
};
Module.setStatus('Downloading...');
window.onerror = function () {
Module.setStatus('Exception thrown, see JavaScript console');
Module.setStatus = function (text) {
if (text) Module.printErr('[post-exception status] ' + text);
};
};
</script>
{{{ SCRIPT }}}
</body>
</html>