-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
412 lines (326 loc) · 15.1 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
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
<!doctype html>
<html lang="en">
<head>
<title>hUmagazine</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!-- CSS loaders -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/style1.css" media="none" id="cssstyle1">
<link rel="stylesheet" href="css/style2.css" media="none" id="cssstyle2">
<link rel="stylesheet" href="css/style3.css" media="none" id="cssstyle3">
<link rel="stylesheet" href="css/style4.css" media="none" id="cssstyle4">
<!-- Google Fonts-->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&display=swap" rel="stylesheet">
<!-- Load jQuery -->
<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Load our JS Library -->
<script language="javascript" src="js/llll.js"></script>
</head>
<body>
<!-- <div class="container-fluid"> MAIN CONTAINER -->
<!-- TOP BAR -->
<div id="topBar" class="sticky-top"></div> <!-- A jQuery function loads content inside this div -->
<!-- body -->
<main id="mainBody" class="container-fluid justify-content-md-around my-2">
<div class="nav-scroller align-items-start py-0 px-4 mb-4">
<nav id="keywordsList" class="nav d-flex justify-content-between">
<!-- Keywords list loaded by JS -->
<p class="p-2 fw-normal text-dark" href="#"><input type="text" id="currentDateTime" disabled></p>
</nav>
</div>
<div class="container-fluid justify-content-center pb-3">
<div class="tech-slideshow">
<div class="mover"></div>
</div>
</div>
<div class="row align-items-start px-4">
<!-- Column with article previews -->
<div class="col leftCol">
<div id="artPreview1_1" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre1_1" class="row mx-1 py-4 customPreview">
<div id="imgPre1_1" class="col col-md-5"></div>
<div id="contentPre1_1" class="col">
<h6 id="titlePre1_1"></h6>
<div id="subPre1_1"></div>
<div id="byPre1_1"></div>
</div>
</div>
<div id="hr"></div>
<div id="artPreview1_2" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre1_2" class="row mx-1 py-4 customPreview">
<div id="imgPre1_2" class="col col-md-5"></div>
<div id="contentPre1_2" class="col">
<h6 id="titlePre1_2"></h6>
<div id="subPre1_2"></div>
<div id="byPre1_2"></div>
</div>
</div>
<div id="hr"></div>
<div id="artPreview1_3" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre1_3" class="row mx-1 py-4 customPreview">
<div id="imgPre1_3" class="col col-md-5"></div>
<div id="contentPre1_3" class="col">
<h6 id="titlePre1_3"></h6>
<div id="subPre1_3"></div>
<div id="byPre1_3"></div>
</div>
</div>
<div id="hr"></div>
<div id="artPreview2_1" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre2_1" class="row mx-1 py-4 customPreview">
<div id="imgPre2_1" class="col col-md-5"></div>
<div id="contentPre2_1" class="col">
<h6 id="titlePre2_1"></h6>
<div id="subPre2_1"></div>
<div id="byPre2_1"></div>
</div>
</div>
<div id="hr"></div>
<div id="artPreview2_2" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre2_2" class="row mx-1 py-4 customPreview">
<div id="imgPre2_2" class="col col-md-5"></div>
<div id="contentPre2_2" class="col">
<h6 id="titlePre2_2"></h6>
<div id="subPre2_2"></div>
<div id="byPre2_2"></div>
</div>
</div>
<div id="hr"></div>
<div id="artPreview2_3" style="display:none"></div> <!-- Hidden div only needed to store data -->
<div id="artPre2_3" class="row mx-1 py-4 customPreview lastBox">
<div id="imgPre2_3" class="col col-md-5"></div>
<div id="contentPre2_3" class="col">
<h6 id="titlePre2_3"></h6>
<div id="subPre2_3"></div>
<div id="byPre2_3"></div>
</div>
</div>
<!-- <div id="artPreview1" class="p-4 mb-3 bg-light rounded customCol lastBox"><button type="button" class="btn mt-3 btn-outline-dark"><a href="https://humagazine.github.io/issue.html?number=1">Read issue</a></button></div> -->
</div> <!-- End of left col -->
<div id="centralMain" class="col col-md-6">
<div class="pb-1">
<h1 class="display-4">welcome to hUmagazine</h1>
<h2>an inclusive, eclectic, and smart online periodical for a new generation of open-minded and fearless folks</h2>
</div>
<hr/>
<div class="py-1">
<p class="lead my-3">On hUmagazine, yoU are in charge of what yoU want to read and how and when yoU want to read it. </p>
<p class="lead my-3"><span class="step">Step 1</span>: Have fun and change the look of the magazine with our style selectors you can always find on the topbar.</p>
</div>
<div class="row row-cols-5 justify-content-center align-items-center px-4">
<div class="col">
<a class="nav-item nav-link active" href="#"onclick="switchToSS (document.getElementById('cssstyle1'),document.getElementById('cssstyle2'),document.getElementById('cssstyle3'),document.getElementById('cssstyle4'))">
<img id="itemIcon1" class="itemIcon" src="img/btns/one.png" width="92" height="92" alt="onefinger">
</a>
</div>
<div class="col">
<a class="nav-item nav-link active" href="#" onclick="switchToSS (document.getElementById('cssstyle2'),document.getElementById('cssstyle1'),document.getElementById('cssstyle3'),document.getElementById('cssstyle4'))">
<img id="itemIcon2" class="itemIcon" src="img/btns/two.png" width="92" height="92" alt="twofingers">
</a>
</div>
<div class="col">
<a class="nav-item nav-link active" href="#" onclick="switchToSS (document.getElementById('cssstyle3'),document.getElementById('cssstyle1'),document.getElementById('cssstyle2'),document.getElementById('cssstyle4'))">
<img id="itemIcon3" class="itemIcon" src="img/btns/three.png" width="92" height="92" alt="threefingers">
</a>
</div>
<div class="col">
<a class="nav-item nav-link active" href="#" onclick="switchToSS (document.getElementById('cssstyle4'),document.getElementById('cssstyle1'),document.getElementById('cssstyle2'),document.getElementById('cssstyle3'))">
<img id="itemIcon4" class="itemIcon" src="img/btns/four.png" width="92" height="92" alt="fourfingers">
</a>
</div>
<div class="col">
<a class="nav-item nav-link active" href="#" onclick="cleanUpSS()" alt="Clean Up">
<img id="refreshIcon" class="itemIcon" src="img/btns/refresh.png" width="92" height="92" alt="refresh button">
</a>
</div>
</div>
<div class="row row-cols-5 justify-content-center align-items-center px-4">
<div class="col">
<div id="a1" class="arrow"></div>
</div>
<div class="col">
<div id="a2" class="arrow"></div>
</div>
<div class="col">
<div id="a3" class="arrow"></div>
</div>
<div class="col">
<div id="a4" class="arrow"></div>
</div>
<div class="col">
<div id="a5" class="arrow"></div>
</div>
</div>
<div class="row row-cols-5 justify-content-center align-items-center px-4">
<div class="col">
<p class="date">1500</p>
</div>
<div class="col">
<p class="date">1950</p>
</div>
<div class="col">
<p class="date">1990</p>
</div>
<div class="col">
<p class="date">2030</p>
</div>
<div class="col">
<p class="date">refresh</p>
</div>
</div>
<p class="lead my-3"><span class="step">Step 2</span>: Choose a topic you wish to learn more about.</p>
<p class="lead my-3"><span class="step">Step 3</span>: Read the three articles we selected for you, explore them through metadata, and get a feel for the subject.</p>
<h4>Click one and try it out right now!</h4>
<p></p>
<hr/>
<div class="pt-3">
<h3 class="fst-italic">Want to learn more?</h3>
<p class="lead my-3">Read the full documentation about hUmagazine's philosophy, design, and techical choices.</p>
<button type="button" class="btn mt-3 btn-outline-dark"><a href="documentation.html" target="_blank">Learn more...</a></button>
</div>
</div>
<div class="col rightCol">
<div style="top: 2rem;"> <!-- class="position-sticky" -->
<div class="p-4 mb-3 bg-light rounded customCol">
<h3 class="fst-italic">Learn a new word!</h3>
<strong class="mb-0" id="learnterm">:</strong> <!-- This div gets filled up with random term from glossaryDb.json -->
<span class="mb-0" id="learndefinition"></span> <!-- This div gets filled up with correspondent definition from glossaryDb.json -->
</div>
</div>
<div id="hr"></div>
<div class="position-sticky" style="top: 2rem;">
<div class="p-4 mb-3 bg-light rounded customCol lastBox">
<h3 class="fst-italic">Think you’re not biased? Think again</h3>
<p class="mb-0"><span id="projectImplicit"><b>Project Implicit</b></span> is a non-profit organization committed to advancing scientific knowledge about stereotypes, prejudice, and other group-based biases.</p>
<button type="button" class="btn mt-3 btn-outline-dark"><a href=" https://implicit.harvard.edu/implicit/takeatest.html" target="_blank">Take their test now</a></button>
<button type="button" class="btn mt-3 btn-outline-dark"><a href="https://www.projectimplicit.net" target="_blank">Learn more about the project</a></button>
</div>
</div>
</div> <!-- End of right col -->
</div>
<div class="container-fluid justify-content-center py-3">
<div class="tech-slideshow">
<div class="mover"></div>
</div>
</div>
</main>
<!-- FOOTER -->
<div id="footerBar"></div>
<!-- Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script>
// Display current date
var today = new Date();
var days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];
var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
var day = days[ today.getDay() ];
var month = months[ today.getMonth() ];
var currentDate = day + ", " + month + " " + today.getDate() + ", " + today.getFullYear();
document.getElementById("currentDateTime").value = currentDate;
// Random glossary definitions into lateral box
$.getJSON('./glossaryDb.json', function(objson){
const lenGloss = objson.glossary.length;
// console.log(lenGloss); // debug
const rndInt = randomIntFromInterval(0, lenGloss-1);
// console.log(rndInt); // debug
$("#learnterm").prepend(objson["glossary"][rndInt]["term"]);
$("#learndefinition").append(objson["glossary"][rndInt]["definition"]);
}).fail(function(){
//console.log("Get from glossaryDb: an error has occurred.");
});
// Populates the list of keywords on top of page reading keywords from issuesDb.json
$.getJSON('./issuesDb.json', function(objson){
const kwSet = new Set();
for (i=0; i<objson["issues"].length; i++) {
//console.log("i="+i);
for (a=1; a<=3; a++) { // Three articles for each magazine issue
//console.log("a="+a);
for (k=1; k<=3; k++) { // Three keywords for each article
//console.log("k="+k);
if (objson["issues"][i]["art"+a+"KW"+k]) {
kwSet.add(objson["issues"][i]["art"+a+"KW"+k]); // To avoid repetitions
}
}
}
}
var cntr=0;
for (let item of kwSet){
if (cntr<9) {
$("#keywordsList").prepend('<p class="p-2 link-secondary kwCustom mt-2">' + item + '</p>');
cntr++;
}
}
$("#keywordsList").prepend('<p id="kW" class="p-2 fw-normal text-dark mt-2">Keywords:</p>');
}).fail(function(){
console.log("Get from issuesDb: an error has occurred.");
});
// Load articles preview
$.ajax({
url: 'articles/article1_1.html',
type: 'get',
success: function(html) {
getPreData(html,1,1);
}
});
$.ajax({
url: 'articles/article1_2.html',
type: 'get',
success: function(html) {
getPreData(html,1,2);
}
});
$.ajax({
url: 'articles/article1_3.html',
type: 'get',
success: function(html) {
getPreData(html,1,3);
}
});
$.ajax({
url: 'articles/article2_1.html',
type: 'get',
success: function(html) {
getPreData(html,2,1);
}
});
$.ajax({
url: 'articles/article2_2.html',
type: 'get',
success: function(html) {
getPreData(html,2,2);
}
});
$.ajax({
url: 'articles/article2_3.html',
type: 'get',
success: function(html) {
getPreData(html,2,3);
}
});
// Reads specific ids from html and writes them in article preview divs
function getPreData(html,i,a) {
var trimmed = String(html);
trimmed=trimmed.substring(0, 1225);
//console.log(trimmed);
$("#artPreview"+i+"_"+a).prepend(trimmed);
var linktag='<a href="issue.html?number='+i+'">';
var closelinktag="</a>";
var imgtag="<img src=\"" + $("#img"+i+"_"+a).attr("src") + "\" width=\"100%\" class=\"articleImg\">";
var titletext=$("#title"+i+"_"+a).text();
var byline=$("#byline"+i+"_"+a).text();
//console.log(linktag + imgtag + closelinktag);
$("#imgPre"+i+"_"+a).append(linktag + imgtag + closelinktag);
$("#titlePre"+i+"_"+a).append(linktag + titletext + closelinktag);
$("#byPre"+i+"_"+a).append(byline);
}
</script>
</body>
<!-- Script Loaders-->
</html>