This repository has been archived by the owner on Mar 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
executable file
·288 lines (243 loc) · 7.69 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebVR City Visualization Experiment</title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE-edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<style>
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
color: #eee;
overflow: hidden;
background: rgb(40, 40, 40);
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
/* for all svg icons */
fill: rgba(200, 200, 200, 0.5);
}
canvas {
width: 100% !important;
height: 100% !important;
position: absolute;
top: 0;
left: 0;
}
#video {
display: none;
}
#controls {
position: absolute;
bottom: 44px;
/*left: 20px;*/
background-color: rgba(80, 80, 80, 0.6);
z-index: 2;
padding: 20px 20px 0 20px;
}
#controls > div {
padding-bottom: 20px;
}
#info {
z-index: 100;
position: absolute;
left: 10px;
top: 10px;
border-radius: 5px;
box-sizing: border-box;
}
#info.open {
background-color: rgba(20, 20, 20, 0.5);
}
#info > article {
display: none;
margin: 0 0 0 40px;
padding: 10px;
width: 350px;
font-size: 14px;
text-shadow: 0 1px 0 rgba( 255,255,255,.2 ), 0 -1px 0 rgba( 0,0,0,.2 );
}
a,
a:visited {
color: #eee;
}
#info.open > article {
display: block;
}
#infobutton {
width: 20px;
height: 20px;
margin: 10px;
float: left;
cursor: pointer;
}
h1 {
font-size: 16px;
margin: 0 0 4px;
}
#buttons > * {
margin-left: 20px;
}
#buttons > *:first-child {
margin-left: 0;
}
:-webkit-full-screen {
cursor: none;
}
:-moz-full-screen {
cursor: none;
}
#connection-info {
z-index: 100;
position: absolute;
width: 280px;
height: 280px;
bottom: 44px;
right: 0;
/*margin: 10px;*/
/*border: rgba(100, 100, 100, 0.6) solid 2px;*/
}
#connection-info.min {
width: 20px;
height: 20px;
}
#connection-info.min #qrcode {
padding: 0;
}
#qrcode {
padding: 40px;
background-color: white;
}
#qrcode > img {
width: 100%;
height: 100%;
}
#minimize {
position: absolute;
width: 0px;
height: 0px;
top: 2px;
right: 2px;
border: 10px transparent solid;
border-top: 15px darkgrey solid;
}
#minimize:hover {
border-top: 15px black solid;
}
#connection-info.min #minimize {
display: none;
}
footer {
z-index: 1;
position: fixed;
bottom: 0;
left: 0;
box-sizing: border-box;
width: 100%;
height: 44px;
padding: 10px;
overflow: hidden;
background-color: rgba(80, 80, 80, 0.6);
}
.vizicities-attribution {
position: fixed;
bottom: 0;
right: 0;
z-index: 2;
padding: 10px 4px;
font-size: 10px;
}
.vizicities-attribution a,
.vizicities-attribution a:visited {
color: #ffffff;
text-decoration: none;
}
#hmd-info {
position: absolute;
right: 0;
top: 0;
font-size: 10px;
padding: 4px;
}
#hmd-info.has-hmd {
color: rgb(0, 255, 0);
}
h2 {
font-size: 1em;
}
</style>
</head>
<body>
<div id="controls">
<div id="dataviz-info"></div>
<div id="buttons">
<button id="fs">FS</button>
<button id="vr" disabled>VR</button>
<span>
<input id="location" type="text" placeholder="Search for a location"/>
<button id="search">Go</button>
</span>
<select id="visualization">
<option value="">None</option>
<option value="income">Income Data (Bars)</option>
<option value="income-bubbles">Income Data (Bubbles)</option>
<option value="population">Population</option>
<option value="bike">Bike and Run</option>
<option value="police">Police Injury Claims (High)</option>
<option value="police-lo">Police Injury Claims (Low)</option>
</select>
</div>
</div>
<div id="info">
<svg version="1.1" id="infobutton" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="112px" height="112px" viewBox="0 0 112 112" enable-background="new 0 0 112 112" xml:space="preserve">
<g>
<path d="M60.361,28.418c-0.563-0.434-1.214-0.742-1.97-0.915c-0.741-0.172-1.544-0.261-2.389-0.261
c-0.851,0-1.652,0.089-2.414,0.261c-0.76,0.173-1.422,0.481-1.987,0.915c-0.56,0.435-1.003,1.012-1.33,1.723
c-0.327,0.714-0.485,1.604-0.485,2.679c0,1.05,0.164,1.932,0.485,2.655c0.327,0.724,0.767,1.312,1.33,1.745
c0.565,0.435,1.228,0.751,1.987,0.934c0.761,0.187,1.563,0.28,2.414,0.28c0.845,0,1.646-0.095,2.389-0.28
c0.756-0.183,1.404-0.504,1.97-0.934c0.56-0.434,1.013-1.018,1.349-1.745c0.336-0.72,0.504-1.605,0.504-2.655
c0-1.073-0.168-1.969-0.504-2.679C61.374,29.43,60.921,28.852,60.361,28.418z"></path>
<rect x="50.271" y="42.912" width="11.419" height="41.846"></rect>
</g>
<path d="M56,0C25.074,0,0,25.074,0,56s25.074,56,56,56s56-25.074,56-56S86.926,0,56,0z M56,102.666
C30.227,102.666,9.333,81.773,9.333,56C9.333,30.226,30.227,9.333,56,9.333S102.666,30.226,102.666,56
C102.666,81.773,81.773,102.666,56,102.666z"></path>
</svg>
<article>
<h1>WebVR 3D Map Experiment</h1>
<p>This demonstrates an experimental virtual reality interaction using a mobile browser to fly around a representation of a real-world city. Enter the name of a location in the text box below to search for a location to visit. Scan (or right-click and copy) the QR code for a link to open in mobile Chrome or Firefox. Touch and drag in any direction to move around the space. You will move in whatever direction you're dragging, taking into account the direction the device is pointing. You can shake the phone quickly to turn around 180 degrees.</p>
<p>If you don't have an Android phone, you can look around with WASD keys and move with the arrow keys</p>
<p>Load this site in an experimental WebVR build of either <a href="http://mozvr.com/downloads.html" target="_new">Firefox</a> or <a href="http://blog.tojicode.com/2014/07/bringing-vr-to-chrome.html" target="_new">Chrome</a>. When the Rift is connected, hit the "Enter" key or click the "VR" button to enter full-screen VR mode. Hit "Escape" to exit VR and release the mouse cursor.</p>
<p>Code by <a href="http://chirls.com">Brian Chirls</a> is available on <a href="https://github.com/povdocs/webvr-cities/">GitHub</a>.</p>
</article>
</div>
<div id="connection-info" style="display: none;">
<span id="minimize"></span>
<a id="link" target="_blank"><div id="qrcode"></div></a>
</div>
<footer>
<div id="location-name"></div>
<div id="hmd-info"></div>
</footer>
<script src="js/lib/vizi.js"></script>
<script src="js/lib/DeviceOrientationControls.js"></script>
<script src="js/lib/VRStereoEffect.js"></script>
<script src="js/lib/VRControls.js"></script>
<script src="js/lib/stats.min.js"></script>
<script src="https://skyway.io/dist/0.3/peer.js"></script>
<script src="js/RemoteWalkControl.js"></script>
<script src="js/lib/shaders/SSAOShader.js"></script>
<script src="js/lib/postprocessing/ShaderPass.js"></script>
<script src="js/lib/qrcode.js"></script>
<script src="js/BlueprintInputCSV.js"></script>
<script src="js/BlueprintOutputBars.js"></script>
<script src="js/BlueprintOutputBarTiles.js"></script>
<script src="js/BlueprintOutputParticleTiles.js"></script>
<!-- for population data viz. would ideally load this later with
requirejs, but it don't work with vizicities -->
<script src="js/lib/rhill-voronoi-core.js"></script>
<script src="js/lib/QuadTree.js"></script>
<script src="js/main.js" type="text/javascript"></script>
</body>
</html>