1
0

index.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title><!-- title --></title>
  5. <meta charset="utf-8">
  6. <meta name="generator" content="Three.js Editor">
  7. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  8. <style>
  9. body {
  10. font-family: sans-serif;
  11. font-size: 11px;
  12. background-color: #000;
  13. margin: 0px;
  14. }
  15. canvas {
  16. display: block;
  17. }
  18. </style>
  19. </head>
  20. <body ontouchstart="">
  21. <script type="importmap">
  22. {
  23. "imports": {
  24. "three": "./js/three.module.js"
  25. }
  26. }
  27. </script>
  28. <script type="module">
  29. import * as THREE from 'three';
  30. import { APP } from './js/app.js';
  31. window.THREE = THREE; // Used by APP Scripts.
  32. var loader = new THREE.FileLoader();
  33. loader.load( 'app.json', function ( text ) {
  34. var player = new APP.Player();
  35. player.load( JSON.parse( text ) );
  36. player.setSize( window.innerWidth, window.innerHeight );
  37. player.play();
  38. document.body.appendChild( player.dom );
  39. window.addEventListener( 'resize', function () {
  40. player.setSize( window.innerWidth, window.innerHeight );
  41. } );
  42. } );
  43. /* edit button */
  44. </script>
  45. </body>
  46. </html>