-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
92 lines (81 loc) · 3.3 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
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
<!DOCTYPE html>
<html>
<head>
<title>Photo Sphere Viewer</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="photo-sphere-viewer.min.css">
<style>
html, body {
height: 100%;
font-family: "roboto", "aktiv-grotesk", "helvetica neue", "helvetica", sans-serif;
margin: 0;
box-sizing: border-box;
background-color: #ffffff;
color: #383838;
}
#viewer {
width: 100vw;
height: 100vh;
visibility: hidden;
position: absolute;
top: 0; left: 0;
}
#content {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
h1 {
margin-bottom: 1em;
}
.callToAction {
padding: 14px 12px;
background-color: #00adef;
border-radius: 4px;
color: #fff;
text-decoration: none;
font-family: "aktiv-grotesk", "helvetica neue", "helvetica", sans-serif;
font-weight: bold;
cursor: pointer;
}
.box_file {
display: none;
}
</style>
</head>
<body>
<div id="content">
<h1>Visualiseur de panorama 360°</h1>
<input class="box_file" type="file" id="uploadimage" />
<label class="callToAction" for="uploadimage">Choisir une image</label>
</div>
<div id="viewer"></div>
<script type="text/javascript" src="polyfill.min.js"></script>
<script type="text/javascript" src="uevent.min.js"></script>
<script type="text/javascript" src="doT.min.js"></script>
<script type="text/javascript" src="three.min.js"></script>
<script type="text/javascript" src="photo-sphere-viewer.min.js"></script>
<script>
var contentElement = document.getElementById("content");
var inputFileElement = document.getElementById("uploadimage");
var viewerElement = document.getElementById("viewer");
function displayPanorama(ev) {
file = inputFileElement.files[0];
url = window.URL || window.webkitURL; // function allowing to have a working url for a local path
src = url.createObjectURL(file);
var viewer = new PhotoSphereViewer({
container: 'viewer',
panorama: src
});
contentElement.style.display = 'none';
viewerElement.style.visibility = 'visible';
}
inputFileElement.addEventListener("change", displayPanorama, false);
</script>
</body>
</html>