index.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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="module">
  22. import * as THREE from './js/three.module.js';
  23. import { APP } from './js/app.js';
  24. import { VRButton } from './js/VRButton.js';
  25. window.THREE = THREE; // Used by APP Scripts.
  26. window.VRButton = VRButton; // Used by APP Scripts.
  27. var loader = new THREE.FileLoader();
  28. loader.load( 'app.json', function ( text ) {
  29. var player = new APP.Player();
  30. player.load( JSON.parse( text ) );
  31. player.setSize( window.innerWidth, window.innerHeight );
  32. player.play();
  33. document.body.appendChild( player.dom );
  34. window.addEventListener( 'resize', function () {
  35. player.setSize( window.innerWidth, window.innerHeight );
  36. } );
  37. } );
  38. /* edit button */
  39. </script>
  40. </body>
  41. </html>