-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·64 lines (56 loc) · 1.54 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js</title>
<meta charset="utf-8">
<meta name="generator" content="Three.js Editor">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
background-color: #000;
margin: 0px;
overflow: hidden;
}
#edit {
position: absolute;
bottom: 20px;
right: 20px;
padding: 8px;
text-decoration: none;
background-color: #fff;
color: #555;
opacity: 0.5;
}
#edit:hover {
opacity: 1;
}
</style>
</head>
<body ontouchstart="">
<script src="js/three.min.js"></script>
<script src="js/app.js"></script>
<script>
var loader = new THREE.FileLoader();
loader.load( 'app.json', function ( text ) {
var player = new APP.Player();
player.load( JSON.parse( text ) );
player.setSize( window.innerWidth, window.innerHeight );
player.play();
document.body.appendChild( player.dom );
window.addEventListener( 'resize', function () {
player.setSize( window.innerWidth, window.innerHeight );
} );
if ( location.search === '?edit' ) {
var button = document.createElement( 'a' );
button.id = 'edit';
button.href = 'https://threejs.org/editor/#file=' + location.href.split( '/' ).slice( 0, - 1 ).join( '/' ) + '/app.json';
button.target = '_blank';
button.textContent = 'EDIT';
document.body.appendChild( button );
}
} );
</script>
</body>
</html>