index.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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>Animation</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="Animation.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. window.BrotliDecode = BrotliDecode;
  30. // Set this to enable Brotli (.br) decompression on static webServers
  31. // that don't support content compression and http://.
  32. var enableBrotliDecompression = false;
  33. Blazor.start({
  34. loadBootResource: function (type, name, defaultUri, integrity)
  35. {
  36. if (enableBrotliDecompression === true && type !== 'dotnetjs' && location.hostname !== 'localhost')
  37. {
  38. return (async function()
  39. {
  40. const response = await fetch(defaultUri + '.br', { cache: 'no-cache' });
  41. if (!response.ok)
  42. throw new Error(response.statusText);
  43. const originalResponseBuffer = await response.arrayBuffer();
  44. const originalResponseArray = new Int8Array(originalResponseBuffer);
  45. const contentType = (type === 'dotnetwasm')
  46. ? 'application/wasm'
  47. : 'application/octet-stream';
  48. const decompressedResponseArray = BrotliDecode(originalResponseArray);
  49. return new Response(decompressedResponseArray,
  50. { headers: { 'content-type': contentType }
  51. });
  52. })();
  53. }
  54. }
  55. });
  56. </script>
  57. <script src="_content/nkast.Wasm.Dom/js/JSObject.8.0.5.js"></script>
  58. <script src="_content/nkast.Wasm.Dom/js/Window.8.0.5.js"></script>
  59. <script src="_content/nkast.Wasm.Dom/js/Document.8.0.5.js"></script>
  60. <script src="_content/nkast.Wasm.Dom/js/Navigator.8.0.5.js"></script>
  61. <script src="_content/nkast.Wasm.Dom/js/Gamepad.8.0.5.js"></script>
  62. <script src="_content/nkast.Wasm.Dom/js/Media.8.0.5.js"></script>
  63. <script src="_content/nkast.Wasm.XHR/js/XHR.8.0.5.js"></script>
  64. <script src="_content/nkast.Wasm.Canvas/js/Canvas.8.0.5.js"></script>
  65. <script src="_content/nkast.Wasm.Canvas/js/CanvasGLContext.8.0.5.js"></script>
  66. <script src="_content/nkast.Wasm.Audio/js/Audio.8.0.5.js"></script>
  67. <script src="_content/nkast.Wasm.XR/js/XR.8.0.5.js"></script>
  68. <script>
  69. function tickJS()
  70. {
  71. window.theInstance.invokeMethod('TickDotNet');
  72. window.requestAnimationFrame(tickJS);
  73. }
  74. window.initRenderJS = (instance) =>
  75. {
  76. window.theInstance = instance;
  77. // set initial canvas size
  78. var canvas = document.getElementById('theCanvas');
  79. var holder = document.getElementById('canvasHolder');
  80. canvas.width = holder.clientWidth;
  81. canvas.height = holder.clientHeight;
  82. // disable context menu on right click
  83. canvas.addEventListener("contextmenu", e => e.preventDefault());
  84. // begin game loop
  85. window.requestAnimationFrame(tickJS);
  86. };
  87. window.onkeydown = function(event)
  88. {
  89. // Prevent Arrows Keys and Spacebar scrolling the outer page
  90. // when running inside an iframe. e.g: itch.io embedding.
  91. if ([32, 37, 38, 39, 40].indexOf(event.keyCode) > -1)
  92. event.preventDefault();
  93. };
  94. window.onmousewheel = function(event)
  95. {
  96. // Prevent Mousewheel scrolling the outer page
  97. // when running inside an iframe. e.g: itch.io embedding.
  98. event.preventDefault();
  99. };
  100. </script>
  101. </body>
  102. </html>