forked from mistic100/Photo-Sphere-Viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathequirectangular.html
More file actions
110 lines (99 loc) · 2.79 KB
/
Copy pathequirectangular.html
File metadata and controls
110 lines (99 loc) · 2.79 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PhotoSphereViewer - equirectangular demo</title>
<link rel="stylesheet" href="../dist/photo-sphere-viewer.css">
<style>
html, body {
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
}
#photosphere {
width: 100%;
height: 100%;
}
.psv-button.custom-button {
font-size: 22px;
line-height: 20px;
}
</style>
</head>
<body>
<div id="photosphere"></div>
<script src="../node_modules/three/build/three.js"></script>
<script src="../node_modules/promise-polyfill/dist/polyfill.js"></script>
<script src="../node_modules/uevent/browser.js"></script>
<script src="../node_modules/nosleep.js/dist/NoSleep.js"></script>
<script src="../dist/photo-sphere-viewer.js"></script>
<script src="../dist/plugins/gyroscope.js"></script>
<script src="../dist/plugins/stereo.js"></script>
<script>
var panos = [
{
url : 'sphere.jpg',
desc: 'Parc national du Mercantour <b>© Damien Sorel</b>',
},
{
url : 'test-sphere.jpg',
desc: 'Test sphere',
},
];
var PSV = new PhotoSphereViewer.Viewer({
container : 'photosphere',
panorama : panos[0].url,
caption : panos[0].desc,
loadingImg : 'assets/photosphere-logo.gif',
fisheye : false,
touchmoveTwoFingers: false,
mousewheelCtrlKey : false,
captureCursor : false,
moveSpeed : 1,
zoomSpeed : 1,
navbar : [
'autorotate', 'zoom', 'move', 'download',
{
title : 'Change image',
className: 'custom-button',
content : '🔄',
onClick : (function () {
var i = 0;
return function () {
i = 1 - i;
PSV.setPanorama(panos[i].url, { longitude: 0, latitude: 0, zoom: 50 })
.then(function () {
PSV.navbar.setCaption(panos[i].desc);
}, function () {});
};
}()),
},
{
title : 'Random position',
className: 'custom-button',
content : '🔀',
onClick : function () {
PSV.animate({
longitude: (Math.random() - 0.5) * 3 / 2 * Math.PI,
latitude : (Math.random() - 0.5) * 3 / 4 * Math.PI,
zoom : Math.random() * 60 + 20,
speed : 1500,
});
},
},
'caption', 'gyroscope', 'stereo', 'fullscreen',
],
plugins : [
[PhotoSphereViewer.GyroscopePlugin, {
touchmove : true,
absolutePosition: false,
}],
PhotoSphereViewer.StereoPlugin,
]
});
</script>
</body>
</html>