-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
119 lines (116 loc) · 5.33 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jazz² Resurrection</title>
<link rel="canonical" href="https://deat.tk/jazz2/wasm/" />
<link rel="shortcut icon" id="favicon" type="image/png" href="favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<link rel="manifest" href="manifest.json" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Jazz² Resurrection" />
<meta property="og:description" content="Play Jazz² Resurrection (open-source Jazz Jackrabbit 2 reimplementation) directly in the browser" />
<meta property="og:image" content="https://emupedia.net/emupedia-game-jazz/logo.gif" />
<style>
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:.74em; background: #000000;}
html, body, #game-container, .emscripten {margin: 0; padding: 0; width: 100%; height: 100%; position: absolute; top: 0;}
#loading-screen{width:100%;min-height:100%;text-align:center;background:#fff;background:radial-gradient(#fff 70%,#eee);transition:1s opacity}
.jazz2-logo{display:block;margin:0 auto;padding:33px 0 60px 0;transform:translateX(-5px);image-rendering:auto;image-rendering:crisp-edges;image-rendering:pixelated;}
#info-message{height:140px;color:#666666;font-size:120%;font-weight:700;}
.more-info{padding-bottom:20px;}
.emscripten {display:none;z-index: 100000;touch-action:none;}
</style>
<!--<script async src="https://www.googletagmanager.com/gtag/js?id=G-DLG5Q7831Y"></script><script>window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','G-DLG5Q7831Y');</script>-->
</head>
<body>
<div id="game-container">
<div id="loading-screen">
<img alt="" src="logo.gif" class="jazz2-logo" draggable="false" />
<div id="info-message">Downloading game assets…</div>
<div class="more-info">
This is a WebAssembly port of <b>Jazz² Resurrection</b>. Further information can be found <a href="https://deat.tk/jazz2/">here</a>.<br>
It requires Google Chrome, Microsoft Edge, Mozilla Firefox or other browser supporting <i>WebAssembly</i>.<br><br>
This preview uses the game data coming from <b>Jazz Jackrabbit 2 Shareware Demo</b> available for free.<br>
The original <code>LICENSE.TXT</code> file of the demo can be found <a href="LICENSE.TXT" target="_blank">here</a>.
</div>
</div>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
</div>
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: [],
arguments: [],
print: function(text) {
console.log(Array.prototype.slice.call(arguments).join(' '));
},
printErr: function(text) {
console.error(Array.prototype.slice.call(arguments).join(' '));
},
canvas: (function() {
var canvas = document.getElementById('canvas');
canvas.addEventListener("webglcontextlost", function(e) { Module.onAbort(); e.preventDefault(); }, false);
return canvas;
})(),
onAbort: function() {
var info = document.getElementById('info-message');
info.innerHTML = "The application crashed.<br/>Refresh the page or check the browser console for details.";
var loading = document.getElementById('loading-screen');
loading.style.display = 'block';
var canvas = document.getElementById('canvas');
canvas.style.display = 'none';
},
setInfo: function(text) {
var info = document.getElementById('info-message');
info.innerHTML = text;
},
setStatus: function(text) {
if (text.length >= 24 && text.substr(0, 19) === 'Downloading data...') {
var s = text.indexOf('(');
if (s == -1) return;
var m = text.indexOf('/', s + 1);
if (m == -1) return;
var e = text.indexOf(')', m + 1);
if (e == -1) return;
var current = (parseInt(text.substr(s + 1, m - s - 1)) / 1048576).toFixed(1);
var total = (parseInt(text.substr(m + 1, e - m - 1)) / 1048576).toFixed(1);
Module.setInfo('Downloading game assets…<br/>' + current + ' MB / ' + total + ' MB');
}
},
monitorRunDependencies: function(left) {
},
onRuntimeInitialized: function() {
var loading = document.getElementById('loading-screen');
loading.style.display = 'none';
var canvas = document.getElementById('canvas');
canvas.style.display = 'block';
window.scrollTo(0, 1);
},
locateFile: function(path) {
//if (path === "jazz2.data" && window.location.hostname === "deat.tk" && window.location.hash !== "#fallback") {
// return "http://deat.wz.cz/jazz2/jazz2.data";
//}
return path;
}
};
if (typeof window == 'object') {
const args = decodeURIComponent(window.location.search.substr(1)).trim().split('&');
for (let i = 0; i != args.length; ++i) {
let j = args[i].indexOf('=');
if(j != -1) {
Module.arguments.push('/' + args[i].substring(0, j));
Module.arguments.push(args[i].substring(j + 1));
} else {
Module.arguments.push('/' + args[i]);
}
}
}
window.onerror = function() {
console.log("onerror: " + event);
};
</script>
<script type="text/javascript" src="jazz2.js"></script>
</body>
</html>