Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Show error message if run as a local file
authorJulian Fietkau <git@fietkau.software>
Mon, 23 Sep 2024 10:35:59 +0000 (12:35 +0200)
committerJulian Fietkau <git@fietkau.software>
Mon, 23 Sep 2024 10:35:59 +0000 (12:35 +0200)
index.html

index fb7e8a5231837155e95c57561fcba5a441ff29bc..d01bd97dcaec3711a9610b32f8a14c2fcb979115 100644 (file)
 <script type="importmap">
   {
     "imports": {
-      "three": "/three.module.js",
+      "three": "./three.module.js",
       "three/addons/": "./addons/"
     }
   }
 <canvas width="800" height="800"></canvas>
 </div>
 </div>
-<script type="module" src="/main.js"></script>
+<script type="module" src="main.js"></script>
+<script>
+if(!['https:', 'http:'].includes(window.location.protocol)) {
+  document.querySelectorAll('.game-upintheair .ui-page:not(.loading)').forEach(page => page.remove());
+  document.querySelector('.game-upintheair .loading div').innerText = 'This game cannot run without a web server.';
+}
+</script>
 </body>
 </html>