-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstory0.html
509 lines (417 loc) · 17.2 KB
/
story0.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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>0: Scrollytelling Elements and Effects!</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="img/logo.svg">
<base href="./">
<script src="js/wc.js" async></script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-E1811WRJJD"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-E1811WRJJD');
</script>
</head>
<body id="zero">
<!-- section counter -->
<div id="sectionCounterdiv">
<p id="sectionCounter"></p>
</div>
<!-- section categories -->
<section id="categories">
<span><a href="#scrolls">Scroll Effects</a></span>
<span><a href="#images">Images</a></span>
<span><a href="#threeD">3D</a></span>
<span><a href="#dataviz">Data Visualizations</a></span>
<span><a href="#sounds">Sounds</a></span>
<span><a href="#movies">Movies</a></span>
<span><a href="#game">Game Elements</a></span>
</section>
<!-- section top -->
<section class="top">
<a href=" https://humanatlas.io" class="topLogo">
<img class="logo" src="img/logo.svg"> Human Atlas Stories
</a>
<div class="dropdown">
<button class="dropbtn"><svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" fill="#c2cae5"
class="bi bi-list" viewBox="-1 -4 20 20">
<path fill-rule="evenodd"
d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z" />
</svg>
<i class="fa fa-caret-down"></i>
</button>
<div class="dropdown-content">
<a href=" https://hubmapconsortium.github.io/hra-previews/pilots/pilot4.html">Scrollytelling Series</a>
<a href="story1.html">What is a Human Reference Atlas?</a>
<!-- <a href="story2.html">2. Get to Know Your Anatomical Structures!</a>
<a href="story3.html">3. Learn about Visualizing Cells in the Human Body</a> -->
</div>
</div>
</section>
<h1 id="scrolls" class="TitleDivide">Scroll Effects</h1>
<section>
<h1>Crossfade images</h1>
<div class="img-wrapper">
<div style="background-image: url(img/bg.jpg); color:white;font-size:30px;text-align: center;vertical-align: middle;display: flex;
justify-content: center;align-items: center;">Slow Fade In</div>
<div class="front" style="background-image: url(img/bg2.png);"></div>
</div>
<!-- gsap -->
<h1>Horizontal change</h1>
<section class="comparisonSection">
<div class="comparisonImage beforeImage" style=" overflow-x: hidden;">
<img src="img/cell1.png" alt="before" width="300px" height="300px">
</div>
<div class="comparisonImage afterImage" style="overflow-x:hidden">
<img src="img/cell2.png" alt="after" width="300px" height="300px">
</div>
</section>
<h1>Scroll in Images</h1>
<section class="body">
<img src="img/VHF w kidneys.png" class="fullbody piece" alt="fullbody">
<p class="piece txt2">Kidneys</p>
<img src="img/kidney flat.png" class="outsole piece" alt="Kidneys">
<p class="piece txt3">protein</p>
<img src="img/protein3.png" class="midsole2 piece" alt="protein">
<p class="piece txt4">podo</p>
<img src="img/podo with data.png" class="midsole piece" alt="podo">
</section>
<h1>Scroll in Images 2</h1>
<section class="personskull">
<img src="img/story1-1.png" class="fullface piece">
<img src="img/story1-2.png" class="skull piece">
<img src="img/story1-3.png" class="brain1 piece">
<img src="img/story1-4.png" class="brain2 piece">
<p class="piece skulltxt1">There are XX cells in the human body.</p>
</section>
<h1>Move on image</h1>
<section class="moveimg">
<img src="img/graphbg.png" class="graphbg piece">
<img src="img/char1.png" class="char1 piece">
<img src="img/char1.png" class="char12 piece">
</section>
<h1>Parallax example</h1>
<div class="parallax" style="color:white;font-size:30px;text-align: center;vertical-align: middle;display: flex;
justify-content: center;align-items: center;">This background image is parallaxed</div>
<div id="fadetests">
<h1>Fade In effects</h1>
<h2>Fade In</h2>
<div class="js-scroll fade-in">
<img src="img/image1.gif" width="100%">
</div>
<h2>Fade In From Bottom</h2>
<div class="js-scroll fade-in-bottom">
<img src="img/image2.gif" width="100%">
</div>
<h2>Fade in slide from left</h2>
<div class="js-scroll slide-left">
<img src="img/image3.gif" width="100%">
</div>
</div>
</section>
<h1 id="images" class="TitleDivide">Images</h1>
<!-- section one -->
<section id="section1">
<div id="TiffExample">
<h1>Animation Using Animated WEBP File</h1>
<img src="img/bird-wings-flying-feature.webp" style="max-width: 600px;" width="100%">
</div>
</section>
<h1 id="threeD" class="TitleDivide">3D</h1>
<section>
<div id="glbtest">
<h1>3D GLB file test</h1>
<model-viewer class="brainmodel" src="img/Allen_F_Brain.glb" alt="3D brain model" loading="eager"
auto-rotate ios-src="img/Allen_F_Brain.glb" camera-controls touch-action="pan-y" disable-zoom
disable-tap disable-pan>
<div id="progress-bar-d" slot="progress-bar"></div>
</model-viewer>
</div>
<h1>On touch 3D animation</h1>
<p style="text-align:center">Using spline seems like the easiest option for making simple 3D animations from the
models we have.</p>
<iframe src='https://my.spline.design/untitled-9ae334a07f9a68a7deef16b00a4693ff/' frameborder='0' width='100%'
height='800px' style="margin: auto; display: flex;"></iframe>
</section>
<h1 id="dataviz" class="TitleDivide">Data Visualization</h1>
<!-- section two -->
<section id="section2">
<h1>Sankey Diagram</h1>
<p>Embedded directly from the software.docs.hubmapconsortium.org site. Not always reliable.</p>
<iframe id="sankey" src="https://software.docs.hubmapconsortium.org/data-sankey/index.html" width="100%"
height="900px" scrolling="no" style="border:none;">
</iframe>
<h1>CCF Organ info example</h1>
<div class="mat-typography" style="height:100%;">
<!-- <ccf-organ-info
organ-iri="http://purl.obolibrary.org/obo/UBERON_0004538"
hubmap-data-service="search-api"
hubmap-portal-url="https://portal.test.hubmapconsortium.org/"
hubmap-data-url="https://search.api.hubmapconsortium.org/v3/entities/search"
hubmap-asset-url="https://assets.test.hubmapconsortium.org"
></ccf-organ-info> -->
<ccf-organ-info organ-iri="http://purl.obolibrary.org/obo/UBERON_0002113"></ccf-organ-info>
</div>
</section>
<h1 id="sounds" class="TitleDivide">Sounds</h1>
<!-- section three -->
<section id="section3">
<h1>Music/audio test</h1>
<diV class="togetheridv">
<span class="audiobutton" onclick="play()">Press to play sound</span>
<span class="audiobutton" onclick="turnOff()">Press to pause sound</span>
</diV>
</section>
<!-- section four -->
<h1 id="movies" class="TitleDivide">Movies</h1>
<section id="section4">
<h1>Displaying text over a video video</h1>
<div id="section-movie">
<video autoplay="" muted="" loop="" id="video-background">
<source src="img/image4.mp4" type="video/mp4">
</video>
<span>Text over video example</span>
</div>
<h1>Displaying an MP4 video</h1>
<video loop="true" style="border-radius: 6px; max-width: 600px;" width="100%" autoplay="autoplay" muted>
<source src="img/image4.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<h1>Embedded YouTube video</h1>
<iframe width="100%" style="max-width:600px" height="315" src="https://www.youtube.com/embed/2G0de7GliYo"
title="YouTube video player" frameborder="0" allow="" allowfullscreen></iframe>
</section>
<h1 id="game" class="TitleDivide">Game Elements</h1>
<!-- section three -->
<section id="section5">
<h1>Construct3 Example</h1>
<embed type="text/html" src="Game/index.html" width="100%" height="500" style="max-width:600px">
<h1>Drag and Drop Example</h1>
<p>Drag the round equation into the box with the right answer.</p>
<img src="img/dragbox2.svg" id="gate" class="droppable dropbox">
<img src="img/dragbox1.svg" id="wrong" class="dropbox">
<img src="img/dragobj.svg" id="equation">
</section>
<!-- BotNav -->
<section class="botNav">
<a href="index.html" class="previous"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"
fill="currentColor" class="bi bi-arrow-left" viewBox="0 -3 16 16">
<path fill-rule="evenodd"
d="M15 8a.5.5 0 0 0-.5-.5H2.707l3.147-3.146a.5.5 0 1 0-.708-.708l-4 4a.5.5 0 0 0 0 .708l4 4a.5.5 0 0 0 .708-.708L2.707 8.5H14.5A.5.5 0 0 0 15 8z" />
</svg> Go to Home</a>
<a href="story1.html" class="next">Story 1: <span class="nextTitle">What Is An HRA?</span><svg
xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-right"
viewBox="0 -3 16 16">
<path fill-rule="evenodd"
d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z" />
</svg></a>
</section>
<footer>
@ 2024 Human Atlas Design System at Indiana University
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.4/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.3/ScrollTrigger.min.js"></script>
</body>
<script src="scripts.js"></script>
<!--It helps to handle how the 3D Object would be displayed -->
<script type="module" src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"></script>
<script nomodule src="https://unpkg.com/@google/model-viewer/dist/model-viewer-legacy.js"></script>
<!-- Add music -->
<audio id="audio" src="music/Piano.mp3" loop="" preload="auto"></audio>
<script>
function play() {
var audio = document.getElementById("audio");
audio.play();
}
function turnOff() {
var audio = document.getElementById("audio");
audio.pause();
}
// make sure to refresh hard to get the right values
var rand = Math.floor((Math.random() * 1000000) + 1);
var iframe = document.getElementById('sankey');
iframe.src = "https://software.docs.hubmapconsortium.org/data-sankey/index.html?uid=" + rand;
// resize on window resize
function reload() {
iframe.src = "https://software.docs.hubmapconsortium.org/data-sankey/index.html?uid=" + rand;
}
window.onresize = reload;
//categories show
window.onscroll = function (e) {
if (window.scrollY > 70) {
document.getElementById("categories").style.opacity = "1";
}
if (window.scrollY < 70) {
document.getElementById("categories").style.opacity = "0";
}
};
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
//crossfade imgs
const checkpoint = 1000;
window.addEventListener("scroll", () => {
const currentScroll = window.pageYOffset;
if (currentScroll <= checkpoint) {
opacity = 1 - currentScroll / checkpoint;
} else {
opacity = 0;
}
document.querySelector(".front").style.opacity = opacity;
});
// gsap
gsap.utils.toArray(".comparisonSection").forEach(section => {
let tl = gsap.timeline({
scrollTrigger: {
trigger: section,
start: "center center",
end: () => "+=" + section.offsetWidth,
scrub: true,
pin: true,
anticipatePin: 1
},
defaults: {
ease: "none"
}
});
tl.fromTo(section.querySelector(".afterImage"), {
xPercent: 0,
x: 0,
}, {
xPercent: 0
})
.fromTo(section.querySelector(".afterImage img"), {
xPercent: -100,
x: 0,
}, {
xPercent: 0
}, 0);
});
//drop in
gsap.timeline({
scrollTrigger: {
trigger: ".body",
start: "center center",
end: "bottom top",
scrub: true,
pin: true
}
})
.from(".midsole", {
y: innerHeight * 1.5
})
.from(".txt4", {
y: innerHeight * 1.5
})
.from(".midsole2", {
y: innerHeight * 1.5
})
.from(".txt3", {
y: innerHeight * 1.5
})
.from(".outsole", {
y: innerHeight * 1.5
})
.from(".txt2", {
y: innerHeight * 1.5
});
//drop in 2
gsap.timeline({
scrollTrigger: {
trigger: ".personskull",
start: "center center",
end: "bottom top",
scrub: true,
pin: true
}
})
.from(".skull", {
opacity: 0
})
.from(".brain1", {
opacity: 0
})
.from(".brain2", {
opacity: 0
})
.from(".skulltxt1", {
opacity: 0
});
//drop in 3
gsap.timeline({
scrollTrigger: {
trigger: ".moveimg",
start: "center center",
end: "bottom top",
scrub: true,
pin: true
}
})
.from(".char1", {
opacity: 100
})
.from(".char1", {
opacity: 0
})
.from(".char12", {
opacity: 0
})
// drag drop
let currentDroppable = null;
equation.onmousedown = function (event) {
let shiftX = event.clientX - equation.getBoundingClientRect().left;
let shiftY = event.clientY - equation.getBoundingClientRect().top;
equation.style.position = 'absolute';
equation.style.zIndex = 1000;
document.body.append(equation);
moveAt(event.pageX, event.pageY);
function moveAt(pageX, pageY) {
equation.style.left = pageX - shiftX + 'px';
equation.style.top = pageY - shiftY + 'px';
}
function onMouseMove(event) {
moveAt(event.pageX, event.pageY);
equation.hidden = true;
let elemBelow = document.elementFromPoint(event.clientX, event.clientY);
equation.hidden = false;
if (!elemBelow) return;
let droppableBelow = elemBelow.closest('.droppable');
if (currentDroppable != droppableBelow) {
if (currentDroppable) { // null when we were not over a droppable before this event
leaveDroppable(currentDroppable);
}
currentDroppable = droppableBelow;
if (currentDroppable) { // null if we're not coming over a droppable now
// (maybe just left the droppable)
enterDroppable(currentDroppable);
}
}
}
document.addEventListener('mousemove', onMouseMove);
equation.onmouseup = function () {
document.removeEventListener('mousemove', onMouseMove);
equation.onmouseup = null;
};
};
function enterDroppable(elem) {
elem.style.background = 'green';
}
function leaveDroppable(elem) {
elem.style.background = '';
}
equation.ondragstart = function () {
return false;
};
</script>
</html>