forked from turban/photosphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
39 lines (35 loc) · 1.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Photo sphere with three.js</title>
<style>
html, body, #sphere { height: 100%; }
body { margin: 0; overflow: hidden; background-color: #000; }
.tm { position: absolute; top: 10px; right: 10px; }
</style>
</head>
<body>
<div id="sphere"></div>
<a href="http://thematicmapping.org/" target="parent" class="tm">
<img src="http://thematicmapping.org/img/thematicmapping.png">
</a>
<script src="js/three.min.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/Photosphere.js"></script>
<script>
var photo = getParameterByName('photo');
if (photo) {
var photosphere = THREE.Photosphere(document.getElementById('sphere'), photo + '.jpg', {
view: getParameterByName('view'),
speed: getParameterByName('speed'),
y: getParameterByName('y')
});
window.onresize = photosphere.resize;
}
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}
</script>
</body>
</html>