-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
90 lines (79 loc) · 3.58 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>DarkKingdomWeb</title>
<base href="/dark-kingdom-web/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="DarkKingdomWeb.styles.css" rel="stylesheet" />
</head>
<body>
<div id="app">
<div style="margin: 1em; font-size: 2em; font-family: 'Segoe UI', sans-serif;">Загрузка...</div>
</div>
<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">?</a>
</div>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script type="module">
import { BrotliDecode } from './js/decode.min.js';
Blazor.start({
loadBootResource: function (type, name, defaultUri, integrity)
{
if (type !== 'dotnetjs' && location.hostname !== 'localhost')
{
return (async function()
{
const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
if (!response.ok)
throw new Error(response.statusText);
const originalResponseBuffer = await response.arrayBuffer();
const originalResponseArray = new Int8Array(originalResponseBuffer);
const decompressedResponseArray = BrotliDecode(originalResponseArray);
const contentType = type === 'dotnetwasm'
? 'application/wasm'
: 'application/octet-stream';
return new Response(decompressedResponseArray,
{ headers: { 'content-type': contentType }
});
})();
}
}
});
</script>
<script src="_content/nkast.Wasm.Dom/js/JSObject.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Dom/js/Window.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Dom/js/Document.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Dom/js/Navigator.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Dom/js/Gamepad.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Dom/js/Media.8.0.1.js"></script>
<script src="_content/nkast.Wasm.XHR/js/XHR.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Canvas/js/Canvas.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Canvas/js/CanvasGLContext.8.0.1.js"></script>
<script src="_content/nkast.Wasm.Audio/js/Audio.8.0.1.js"></script>
<script>
function tickJS()
{
window.theInstance.invokeMethod('TickDotNet');
window.requestAnimationFrame(tickJS);
}
window.initRenderJS = (instance) =>
{
window.theInstance = instance;
// set initial canvas size
var canvas = document.getElementById('theCanvas');
var holder = document.getElementById('canvasHolder');
canvas.width = holder.clientWidth;
canvas.height = holder.clientHeight;
// disable context menu on right click
canvas.addEventListener("contextmenu", e => e.preventDefault());
// begin game loop
window.requestAnimationFrame(tickJS);
};
</script>
</body>
</html>