forked from mistic100/Photo-Sphere-Viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlittle-planet.html
More file actions
77 lines (71 loc) · 2.03 KB
/
Copy pathlittle-planet.html
File metadata and controls
77 lines (71 loc) · 2.03 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PhotoSphereViewer - little planet demo</title>
<link rel="stylesheet" href="../dist/photo-sphere-viewer.css">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="photosphere"></div>
<script src="../node_modules/three/build/three.js"></script>
<script src="../node_modules/uevent/browser.js"></script>
<script src="../dist/photo-sphere-viewer.js"></script>
<script src="../dist/adapters/little-planet.js"></script>
<script>
const panos = [
{
url : 'sphere.jpg',
caption: 'Parc national du Mercantour <b>© Damien Sorel</b>',
},
{
url : 'test-sphere.jpg',
caption: 'Test sphere',
},
];
const viewer = new PhotoSphereViewer.Viewer({
container : 'photosphere',
adapter : PhotoSphereViewer.LittlePlanetAdapter,
panorama : panos[0].url,
caption : panos[0].caption,
loadingImg: 'assets/photosphere-logo.gif',
navbar : [
'autorotate', 'zoom', 'move', 'download',
{
title : 'Change image',
className: 'custom-button',
content : '🔄',
onClick : (() => {
let i = 0;
return () => {
i = 1 - i;
viewer.setPanorama(panos[i].url, {
longitude : 0,
latitude : 0,
zoom : 50,
caption : panos[i].caption,
description: panos[i].description,
});
};
})(),
},
{
title : 'Random position',
className: 'custom-button',
content : '🔀',
onClick : () => {
viewer.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', 'fullscreen',
],
});
</script>
</body>
</html>