runas.rocks/dist/index.html
Giulio De Pasquale 5d55e00961 It is alive
2022-12-07 18:47:57 +01:00

102 lines
3.2 KiB
HTML

<head>
<link rel="stylesheet" href="/css/98.css">
<link rel="stylesheet" href="/css/style.css">
</head>
<body class="bg-gray-800 max-h-screen max-w-screen overflow-auto">
<div class="flex h-screen w-screen">
<div class="window container h-3/4 w-3/4 m-auto">
<div class="title-bar" style="height: 3%;">
<div class="title-bar-text">Doom 95</div>
<div class="title-bar-controls">
<button aria-label="Minimize" class="bg-white" />
<button aria-label="Maximize" class="bg-white" />
<button aria-label="Close" class="bg-white" />
</div>
</div>
<div class="window-body m-0" style="height: 97%;">
<canvas class="h-full w-full m-0" id="canvas" oncontextmenu="event.preventDefault()" tabindex="-1" />
<script>
var commonArgs = [
"-iwad",
"doom1.wad",
"-window",
"-nogui",
"-nomusic",
"-config",
"default.cfg",
"-servername",
"doomflare",
];
var Module = {
onRuntimeInitialized: () => {
callMain(commonArgs);
},
noInitialRun: true,
preRun: () => {
Module.FS.createPreloadedFile(
"",
"doom1.wad",
"doom1.wad",
true,
true
);
Module.FS.createPreloadedFile(
"",
"default.cfg",
"default.cfg",
true,
true
);
},
printErr: function (text) {
if (arguments.length > 1)
text = Array.prototype.slice.call(arguments).join(" ");
console.error(text);
},
canvas: (function () {
var canvas = document.getElementById("canvas");
canvas.addEventListener(
"webglcontextlost",
function (e) {
alert("WebGL context lost. You will need to reload the page.");
e.preventDefault();
},
false
);
return canvas;
})(),
print: function (text) {
console.log(text);
},
setStatus: function (text) {
console.log(text);
},
totalDependencies: 0,
monitorRunDependencies: function (left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(
left
? "Preparing... (" +
(this.totalDependencies - left) +
"/" +
this.totalDependencies +
")"
: "All downloads complete."
);
},
};
window.onerror = function (event) {
Module.setStatus("Exception thrown, see JavaScript console");
Module.setStatus = function (text) {
if (text) Module.printErr("[post-exception status] " + text);
};
};
</script>
<script type="text/javascript" src="websockets-doom.js"></script>
</div></div>
</div>
</body>