forked from leMaik/rs-sphere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
26 lines (25 loc) · 1013 Bytes
/
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
<!DOCTYPE html>
<html style="margin:0;padding:0;overflow:hidden;height:100%;">
<head lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title></title>
<script src="bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
<link rel="import" href="bower_components/rs-sphere/rs-sphere-viewer.html">
</head>
<body style="margin:0;padding:0;height:100%;">
<rs-sphere-viewer src="left.png" src-right="right.png" style="width:100%;height:100%"></rs-sphere-viewer>
</body>
<script>
var params = new URLSearchParams(new URL(window.location.href).search)
var image = document.getElementsByTagName('rs-sphere-viewer')[0]
if (params.has("left")) {
image.setAttribute('src', params.get("left"))
if (params.has("right")) {
image.setAttribute('src-right', params.get("right"))
} else {
image.setAttribute('src-right', '')
}
}
</script>
</html>