-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorganExample.html
228 lines (190 loc) · 9.17 KB
/
organExample.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
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Organ Example</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">
<!-- 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="organs">
<!-- section counter -->
<div id="sectionCounterdiv">
<p id="sectionCounter"></p>
</div>
<!-- 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="story0.html">0. Scrollytelling Elements and Effects!</a>
<a href="story1.html">1. What Is An HRA?</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>
<section>
<div class="organflex">
<div class="organParts">
<img src="img/Organ-body.png" class="organ">
<img src="img/Organ-brain.png" class="organ" id="brainImg">
<img src="img/Organ-kidney.png" class="organ" id="kidneyImg">
<img src="img/Organ-heart.png" class="organ" id="heartImg">
</div>
<div class="tableExample">
<div id="log">Organ information will appear here.</div>
<table id="organTable">
<!--Header -->
<tr>
<th>Organ
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-sort-alpha-down" viewbox="0 -3 20 16" onclick="sortTable(0)" id="sortsvg">
<path fill-rule="evenodd"
d="M10.082 5.629 9.664 7H8.598l1.789-5.332h1.234L13.402 7h-1.12l-.419-1.371h-1.781zm1.57-.785L11 2.687h-.047l-.652 2.157h1.351z" />
<path
d="M12.96 14H9.028v-.691l2.579-3.72v-.054H9.098v-.867h3.785v.691l-2.567 3.72v.054h2.645V14zM4.5 2.5a.5.5 0 0 0-1 0v9.793l-1.146-1.147a.5.5 0 0 0-.708.708l2 1.999.007.007a.497.497 0 0 0 .7-.006l2-2a.5.5 0 0 0-.707-.708L4.5 12.293V2.5z" />
</svg>
</th>
<th>Uberon Term
</th>
<th>Sampling Site</th>
</tr>
<!--Organs -->
<tr>
<td id="kidney">Kidney</td>
<td class="kidney">Kidney Uberon term</td>
<td class="kidney">Kidney Sampling Site</td>
</tr>
<tr>
<td id="brain">Brain</td>
<td class="brain">Brain Uberon term</td>
<td class="brain">Brain Sampling Site</td>
</tr>
<tr>
<td id="heart">Heart</td>
<td class="heart">Heart Uberon term</td>
<td class="heart">Heart Sampling Site</td>
</tr>
</table>
</div>
</div>
</section>
<!-- BotNav -->
<!-- <section class="botNav">
<a href="story2.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> Story 2: <span class="prevTitle">What Is An HRA?</span></a> -->
<!-- <a href="story2.html" class="next">Story 3: <span class="nextTitle">Get to Know Your Anatomical
Structures!</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> -->
</body>
</html>
</section>
<footer>
@ 2023 Human Atlas Design System at Indiana University</footer>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<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>
<script src="scripts.js"></script>
<script>organTable.onmouseover = organTable.onmouseout = handler;
function handler(event) {
function str(el) {
if (!el)
return "null"
return el.id || el.tagName;
}
if (str(event.target) != "TH" & str(event.target) != "TD" & str(event.target) != "svg" & str(event.target) != "sortsvg" & str(event.target) != "path" & str(event.target) != "organTable") {
var newName = str(event.target) + "Img";
if (event.type == 'mouseover') {
document.getElementById("log").innerHTML = 'Organ: ' + str(event.target).charAt(0).toUpperCase() + str(event.target).slice(1);
event.target.style.background = '#FFECAA'
document.getElementById(newName).style.opacity = "1";
var elements = document.getElementsByClassName(str(event.target)); // get all elements
for (var i = 0; i < elements.length; i++) {
elements[i].style.backgroundColor = "rgba(255, 238, 184, 0.441)";
}
}
if (event.type == 'mouseout') {
document.getElementById("log").innerHTML = "Hover over an organ name to get more information";
event.target.style.background = ''
document.getElementById(newName).style.opacity = ".5";
var elements = document.getElementsByClassName(str(event.target)); // get all elements
for (var i = 0; i < elements.length; i++) {
elements[i].style.backgroundColor = "white";
}
}
}
}
function sortTable(n) {
var table,
rows,
switching,
i,
x,
y,
shouldSwitch,
dir,
switchcount = 0;
table = document.getElementById("organTable");
switching = true;
dir = "asc";
while (switching) {
switching = false;
rows = table.rows;
for (i = 1; i < (rows.length - 1); i++) {
shouldSwitch = false;
x = rows[i].getElementsByTagName("TD")[n];
y = rows[i + 1].getElementsByTagName("TD")[n];
if (dir == "asc") {
if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase()) {
shouldSwitch = true;
break;
}
} else if (dir == "desc") {
if (x.innerHTML.toLowerCase() < y.innerHTML.toLowerCase()) {
shouldSwitch = true;
break;
}
}
}
if (shouldSwitch) {
rows[i].parentNode.insertBefore(rows[i + 1], rows[i]);
switching = true;
switchcount++;
} else {
if (switchcount == 0 && dir == "asc") {
dir = "desc";
switching = true;
}
}
}
}
</script>
</html>