forked from zqianem/virtual-ice-homepage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
267 lines (253 loc) · 11.8 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
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="images/favicon.ico" type="image/vnd.microsoft.icon">
<script
src="Virtual%20Ice%20Virtual%20Reality%20Tours%20Byrd%20Polar%20and%20Climate%20Research%20Center_files/google_tag.js"
defer="defer"></script>
<title>Virtual Ice | Virtual Reality Tours | Byrd Polar and Climate Research Center</title>
<link rel="stylesheet" media="all" href="stylesheet.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@100;200;400;600&display=swap" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script>
</head>
<body>
<div class="wrapper">
<div class="content">
<nav class="top-nav">
<h1 class="page-header">Virtual Ice</h1>
<div class="right">
<a class="" href="#footer" title="About">
About
</a>
<a class="nav-icon-button" href="https://www.nsf.gov/funding/pgm_summ.jsp?pims_id=504793"
title="National Science Foundation" target="_blank">
<img src="images/NSF-logo-white-small.png">
</a>
<a class="nav-icon-button" href="https://bpcrc.osu.edu"
title="Byrd Polar and Climate Research Center at The Ohio State University" target="_blank">
<img src="images/OSU-logo-red-small.png">
</a>
</div>
</nav>
<div class="video-banner">
<iframe
src="https://player.vimeo.com/video/530141178?badge=0&autopause=0&player_id=0&app_id=58479&background=1"
frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen id="splash-video"
title="Virtual Ice Explorer - MOSAiC"></iframe>
</div>
<div class="tours side-by-side">
<earth-map class="earth">
<div id="interactionSurface"></div>
<div id="pins">
<a href="https://virtualice.byrd.osu.edu/huascaran/"
lon="-77.6" lat="-9.1">
Huascarán Tour
</a>
<a href="https://virtualice.byrd.osu.edu/kelleys_island/"
lon="-82.68" lat="41.6">
Kelleys Island Tour
</a>
<a href="https://virtualice.byrd.osu.edu/Kennicott/"
lon="-142.92" lat="61.47">
Kennicott Tour
</a>
<a href="https://virtualice.byrd.osu.edu/jakobshavnVR/"
lon="-51.05" lat="69.23">
Jakobshavn Tour
</a>
<a href="https://virtualice.byrd.osu.edu/DryValleys/"
lon="166.68" lat="-77.83">
McMurdo Dry Valleys Tour
</a>
<a href="https://virtualice.byrd.osu.edu/DryValleys/"
lon="0.00" lat="-85.00">
MOSAiC Expedition Tour
</a>
<a href="https://virtualice.byrd.osu.edu/DryValleys/"
lon="-70.83" lat="-13.93">
Quelccaya Tour
</a>
<a href="https://virtualice.byrd.osu.edu/DryValleys/"
lon="0.00" lat="-90">
South Pole Tour
</a>
</div>
</earth-map>
<ul class="tour-list">
<h2>Virtual Tours</h2>
<li>
<p><a href="https://virtualice.byrd.osu.edu/huascaran/" title="Huascarán Tour">Huascarán,
Yungay, Peru</a></p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/kelleys_island/" title="Kelleys Island Tour">Kelleys
Island, Ohio,
United
States</a>
</p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/Kennicott/" title="Kennicott Tour">Kennicott
Glacier, Alaska, United
States</a>
</p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/jakobshavnVR/" title="Jakobshavn Tour">Jakobshavn
Glacier, Western
Greenland</a>
</p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/DryValleys/"
title="McMurdo Dry Valleys Tour">McMurdo Dry Valleys,
Victoria
Land,
Antarctica</a></p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/mosaic/" title="MOSAiC Expedition Tour">MOSAiC
Expedition, Arctic
Ocean</a>
</p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/quelccayaVR/" title="Quelccaya Tour">Quelccaya
Ice Cap, Quelccaya
National
Sanctuary, Peru</a></p>
</li>
<li>
<p><a href="https://virtualice.byrd.osu.edu/southpoleVR/" title="South Pole Tour">South
Pole, Antarctica</a>
</p>
</li>
</ul>
</div>
<div class="footer" id="footer">
<div class="side-by-side">
<div class="side-info">
<h2><strong>Create Your Own Tour</strong></h2>
<p>Tours were created by Kira Harris, Kasey Krok, Daniel Hamilton, and Adelyn Arens using video,
photos,
and data collected by field researchers. Field researchers were
instrumental in providing guidance so that tours genuinely capture the
landscape and research conducted there. Claire Mercer, Pam Theodotou,
and Jason Cervenec also contributed to the tours. A resource explaining
"how to" create your own immersive tours is available <strong><a
href="https://u.osu.edu/virtualice/"
title="learn how to create your own VR tour">here</a></strong>.</p>
</div>
<div class="side-info">
<h2><strong>Tours of The Ohio State University</strong></h2>
<p>There is a small but growing series of virtual field trips to research
facilities
at The Ohio State University <strong><a
href="https://byrd.osu.edu/virtual-field-trips-ohio-state-university"
title="Ohio State virtual field trips">here</a></strong>.</p>
</div>
</div>
<br>
<div style="text-align: center">
<p>Development of these tours was supported by NSF grant #1713537 and a
donation to the Byrd Center by Ohio State Energy Partners/ENGIE.</p>
<p>Direct questions and comments to Jason Cervenec at the Byrd Center via <a
href="mailto:[email protected]?subject=Virtual%20Ice">[email protected]</a>
or 614-688-0080.</p>
</div>
</div>
</div>
</div>
</body>
<script>
$(document).ready(function () {
$("#splash-video").width($(window).width()); // Updates width to 100%, as iframes cannot use "100%"
$("#splash-video").height($(window).width() / 2); // Video is 2:1 ratio, so this ensures it fills the width
$("#splash-video").css("top", -1 * (($(window).width() / 2) / 3.2)); // dynamically adjust what part of the video is visible
// similarly to above, refreshes iframe so that it fits the newly calculated size
var _theframe = document.getElementById("splash-video");
_theframe.contentWindow.location.href = _theframe.src;
});
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
$(".earth").css("display", "none");
}
if (navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {
$(".earth").css("display", "none");
}
</script>
<script src='./webcomponent.js'></script>
<script src="https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js"></script>
<script>
let earthMap = document.querySelector('earth-map');
earthMap.centerLongitude = -83;
earthMap.centerLatitude = 40;
earthMap.zoom = 1.5;
earthMap.griddedBaseColor = [0, 120, 180, 1];
earthMap.vectorColors = {
ne_50m_coastline: [255, 255, 255, 1],
ne_50m_lakes: [255, 255, 255, 1],
ne_50m_rivers_lake_centerlines: [255, 255, 255, 0.5],
ne_50m_graticules_10: [255, 255, 255, 0.1],
};
(async () => {
let res = await fetch('./topology.json');
earthMap.vectorData = await res.json();
})();
earthMap.syncWithAnimationHook = positionPins;
let interactionSurface = document.querySelector('#interactionSurface');
const screenRatio = interactionSurface.clientHeight / 1080;
const PAN_FACTOR = 0.25;
const MIN_ZOOM = 1;
const MAX_ZOOM = 10;
let baseScale;
interact(interactionSurface)
.draggable({
inertia: true,
listeners: {
move (e) {
let lon = earthMap.centerLongitude - PAN_FACTOR * e.dx / earthMap.zoom / screenRatio;
let lat = earthMap.centerLatitude + PAN_FACTOR * e.dy / earthMap.zoom / screenRatio;
earthMap.centerLongitude = modulo(lon, 360, -180);
earthMap.centerLatitude = clamp(lat, -90, 90);
},
},
})
.gesturable({
listeners: {
start (e) {
baseScale = earthMap.zoom;
},
move (e) {
earthMap.zoom = clamp(baseScale * e.scale, MIN_ZOOM, MAX_ZOOM);
},
}
});
interactionSurface.addEventListener('wheel', e => {
e.preventDefault();
let z = earthMap.zoom - 0.25 * Math.sign(e.deltaY);
earthMap.zoom = clamp(z, MIN_ZOOM, MAX_ZOOM);
});
function positionPins() {
let pins = [...document.querySelectorAll('#pins a')];
for (const pin of pins) {
let lonLat = [pin.getAttribute('lon'), pin.getAttribute('lat')];
let point = earthMap.forwardProjectionFunction(lonLat);
if (point) {
pin.style.display = 'block';
pin.style.left = point[0];
pin.style.top = point[1];
} else {
pin.style.display = 'none';
}
}
}
function clamp(x, min, max) {
return x > max ? max : (x < min ? min : x);
}
function modulo(x, y, offset=0) {
return (((x - offset % y ) + y ) % y) + offset;
}
</script>