index.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
  6. <title>Deferred</title>
  7. <base href="./" />
  8. <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
  9. <link href="css/app.css" rel="stylesheet" />
  10. <link href="Deferred.styles.css" rel="stylesheet" />
  11. </head>
  12. <body>
  13. <div id="app">
  14. <div id="loading" style="display: table-cell; margin: auto; width:100vw; height:100vh; vertical-align: middle; background: #ffcc10;">
  15. <div style="display: block; margin: auto; width: 9em; color: white;font-family: 'Segoe UI', sans-serif;">
  16. <div style="text-align: center; font-size: 0.85em;">Made with<br/><a href="https://github.com/kniEngine/kni"><img src="kni.png" border="0" alt="Kni"></a></div>
  17. <div style="text-align: center; font-size: 1.8em;">loading&nbsp;<marquee style="width:0.9em; vertical-align: bottom;">.&nbsp;.&nbsp;.&nbsp;&nbsp;&nbsp;</marquee></div>
  18. </div>
  19. </div>
  20. </div>
  21. <div id="blazor-error-ui">
  22. An unhandled error has occurred.
  23. <a href="" class="reload">Reload</a>
  24. <a class="dismiss">x</a>
  25. </div>
  26. <script src="_framework/blazor.webassembly.js" autostart="false"></script>
  27. <script type="module">
  28. import { BrotliDecode } from './js/decode.min.js';
  29. // Set this to enable Brotli (.br) decompression on static webServers
  30. // that don't support content compression and http://.
  31. var enableBrotliDecompression = false;
  32. Blazor.start({
  33. loadBootResource: function (type, name, defaultUri, integrity)
  34. {
  35. if (enableBrotliDecompression === true && type !== 'dotnetjs' && location.hostname !== 'localhost')
  36. {
  37. return (async function()
  38. {
  39. const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
  40. if (!response.ok)
  41. throw new Error(response.statusText);
  42. const originalResponseBuffer = await response.arrayBuffer();
  43. const originalResponseArray = new Int8Array(originalResponseBuffer);
  44. const contentType = (type === 'dotnetwasm')
  45. ? 'application/wasm'
  46. : 'application/octet-stream';
  47. const decompressedResponseArray = BrotliDecode(originalResponseArray);
  48. return new Response(decompressedResponseArray,
  49. { headers: { 'content-type': contentType }
  50. });
  51. })();
  52. }
  53. }
  54. });
  55. </script>
  56. <script src="_content/nkast.Wasm.Dom/js/JSObject.8.0.2.js"></script>
  57. <script src="_content/nkast.Wasm.Dom/js/Window.8.0.2.js"></script>
  58. <script src="_content/nkast.Wasm.Dom/js/Document.8.0.2.js"></script>
  59. <script src="_content/nkast.Wasm.Dom/js/Navigator.8.0.2.js"></script>
  60. <script src="_content/nkast.Wasm.Dom/js/Gamepad.8.0.2.js"></script>
  61. <script src="_content/nkast.Wasm.Dom/js/Media.8.0.2.js"></script>
  62. <script src="_content/nkast.Wasm.XHR/js/XHR.8.0.2.js"></script>
  63. <script src="_content/nkast.Wasm.Canvas/js/Canvas.8.0.2.js"></script>
  64. <script src="_content/nkast.Wasm.Canvas/js/CanvasGLContext.8.0.2.js"></script>
  65. <script src="_content/nkast.Wasm.Audio/js/Audio.8.0.2.js"></script>
  66. <script>
  67. function tickJS()
  68. {
  69. window.theInstance.invokeMethod('TickDotNet');
  70. window.requestAnimationFrame(tickJS);
  71. }
  72. window.initRenderJS = (instance) =>
  73. {
  74. window.theInstance = instance;
  75. // set initial canvas size
  76. var canvas = document.getElementById('theCanvas');
  77. var holder = document.getElementById('canvasHolder');
  78. canvas.width = holder.clientWidth;
  79. canvas.height = holder.clientHeight;
  80. // disable context menu on right click
  81. canvas.addEventListener("contextmenu", e => e.preventDefault());
  82. // begin game loop
  83. window.requestAnimationFrame(tickJS);
  84. };
  85. window.onkeydown = function(event)
  86. {
  87. // Prevent Arrows Keys and Spacebar scrolling the outer page
  88. // when running inside an iframe. e.g: itch.io embedding.
  89. if ([32, 37, 38, 39, 40].indexOf(event.keyCode) > -1)
  90. event.preventDefault();
  91. };
  92. window.onmousewheel = function(event)
  93. {
  94. // Prevent Mousewheel scrolling the outer page
  95. // when running inside an iframe. e.g: itch.io embedding.
  96. event.preventDefault();
  97. };
  98. </script>
  99. </body>
  100. </html>