-
Notifications
You must be signed in to change notification settings - Fork 0
/
virtual.html
355 lines (307 loc) · 14.1 KB
/
virtual.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SciencePub</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="science,beer" name="keywords">
<meta content="Ciência além da universidade" name="description">
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="img/favicon/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png">
<link rel="manifest" href="img/favicon/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<!-- Google Fonts -->
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i|Raleway:300,400,500,700,800"
rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="lib/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="lib/animate/animate.min.css" rel="stylesheet">
<link href="lib/venobox/venobox.css" rel="stylesheet">
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<!--==========================
Header
============================-->
<header id="header" class="header-fixed">
<div class="container">
<div id="logo" class="pull-left">
<!-- Uncomment below if you prefer to use a text logo -->
<a href="index.html#intro" class="scrollto"><img src="img/logo.png" height="55" title=""></a>
</div>
<nav id="nav-menu-container">
<ul class="nav-menu" style="font-family: 'Aller Light',serif">
<li><a href="#intro">Início</a></li>
<li><a href="index.html#about">Sobre o evento</a></li>
<li><a href="index.html#schedule">Edições</a></li>
<li class="menu-active"><a href="virtual.html">Edições Online</a></li>
<li><a href="local.html">Locais</a></li>
<li><a href="index.html#supporters">Parceiros</a></li>
<li><a href="media.html">Notícias</a></li>
<li><a href="index.html#faq">Perguntas frequentes</a></li>
<li><a href="index.html#contact">Contato</a></li>
</ul>
</nav><!-- #nav-menu-container -->
</div>
</header><!-- #header -->
<main id="main" class="main-page">
<!--==========================
Speaker Details Section
============================-->
<!--==========================
Schedule Section
============================-->
<section id="schedule" class="section-with-bg">
<div class="container wow fadeInUp">
<div class="section-header">
<h2>Lives do SciencePub</h2>
<p id="editions-description"></p>
</div>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link" href="#instagram" role="tab" data-toggle="tab">Instagram</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#youtube" role="tab" data-toggle="tab">YouTube</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="#upcoming" role="tab" data-toggle="tab">Próximas</a>
</li>
</ul>
<div class="tab-content row justify-content-center">
<div role="tabpanel" class="col-lg-12 tab-pane fade container" id="instagram">
</div>
<div role="tabpanel" class="col-lg-12 tab-pane fade container" id="youtube">
</div>
<div role="tabpanel" class="col-lg-12 tab-pane fade container show active" id="upcoming">
</div>
</div>
</section>
</main>
<!--==========================
Footer
============================-->
<footer id="footer">
<div class="footer-top">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 text-center footer-contact">
<div class="social-links">
<a href="https://twitter.com/sciencepubbr" class="twitter"><i class="fa fa-twitter"></i></a>
<a href="https://www.facebook.com/sciencepubbr/" class="facebook"><i
class="fa fa-facebook"></i></a>
<a href="https://www.instagram.com/sciencepubbr/" class="instagram"><i
class="fa fa-instagram"></i></a>
<a href="https://www.youtube.com/channel/UCYVOOYb5aMCGmwOv6GcyedA" class="youtube"><i
class="fa fa-youtube"></i></a>
<a href="https://github.com/sciencepub" class="github"><i class="fa fa-github"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="copyright">
© <strong>SciencePub</strong>. Todos os direitos reservados
</div>
<div class="credits">
<!--
All the links in the footer should remain intact.
You can delete the links only if you purchased the pro version.
Licensing information: https://bootstrapmade.com/license/
Purchase the pro version with working PHP/AJAX contact form: https://bootstrapmade.com/buy/?theme=TheEvent
-->
Designed by <a href="https://bootstrapmade.com/">BootstrapMade</a>
</div>
</div>
</footer><!-- #footer -->
<a href="#" class="back-to-top"><i class="fa fa-angle-up"></i></a>
<!-- JavaScript Libraries -->
<script src="lib/jquery/jquery.min.js"></script>
<script src="lib/jquery/jquery-migrate.min.js"></script>
<script src="lib/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/superfish/hoverIntent.js"></script>
<script src="lib/superfish/superfish.min.js"></script>
<script src="lib/wow/wow.min.js"></script>
<script src="lib/venobox/venobox.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<!-- Contact Form JavaScript File -->
<script src="contactform/contactform.js"></script>
<!-- Template Main Javascript File -->
<script src="js/main.js"></script>
</body>
<script type="application/javascript">
/**
* stats by period
* @param editions
* @returns {{editions: *, speakers: number}}
*/
function statsResumed(editions) {
return {
editions: editions.length,
speakers: editions
.map(c => c.speakers.length)
.reduce((c, e) => c + e, 0)
};
}
/**
* HTML for a year
* @param editions
* @returns {string}
*/
function yearStats(editions) {
var stats = statsResumed(editions);
var html = '<p>' + stats.speakers.toString() + ' palestrantes em ' + stats.editions.toString() + ' edições' + '</p>';
return html;
}
/**
* Past editions
* @param editions
* @param year
* @returns {string}
*/
function pastEditions(editions, year) {
var stats = yearStats(editions);
var html = '<div class="section-header">' +
'<h2>' + year.toString() + '</h2>' + yearStats(editions) +
'</div>';
html += buildScheduleItens(editions);
return html;
}
/**
* Build schedule itens for a year
* @param events
* @returns {string}
*/
function buildScheduleItens(events) {
var html = '';
events.reverse();
events.forEach(function (edition) {
var speakers = '';
var speakersContent = '';
var colHtml = '';
var colHtmlClose = '';
var collumSize = "col-md-4";
var hostsContent = '';
var hostsFnCall = function (host, index) {
if (hostsContent.length > 0) {
hostsContent += ', ' + host.name + '';
return;
}
hostsContent += host.name;
};
var fnCall = function (speaker, index) {
speakers += '<div class="' + collumSize + '"><div class="speaker">' +
'<img src="' + speaker.img + '" alt="' + speaker.name + '">' +
'</div><h4>' + speaker.name + '</h4><h6></h6>' +
'</div>';
speakersContent = speakers;
};
if (edition.speakers.length === 1) {
collumSize = "col-md-8";
}
if (edition.speakers.length > 3) {
colHtml = '<div class="col">'
colHtmlClose = '</div>'
fnCall = function (speaker, index) {
speakers += '<div class="' + 'col-md-6' + '"><div class="speaker">' +
'<img src="' + speaker.img + '" alt="' + speaker.name + '">' +
'</div><h4>' + speaker.name + '</h4><h6></h6>' +
'</div>';
if ((index + 1) % 2 === 0) {
speakersContent += speakersRow(speakers);
speakers = '';
}
};
}
if (edition.speakers.length === 0) {
speakers = '<div class="col-md-8"><div class="speaker"></div><h4>A definir</h4><h6>A definir</h6></div>';
}
edition.hosts.forEach(hostsFnCall);
html += '<div class="row schedule-item">' +
'<div class="col-md-3"><h4><a href="' + edition.link + '" style="color: #0e1b4d;">' + edition.title + '</a></h4>' +
'<h6>' + edition.platform + '</h6>' +
'<h6><a>Apresentação:</a> ' + hostsContent + '</h6></div>' +
'<div class="col-md-1">' +
'<time>' + edition.date + '</time><br>' +
'<time>' + edition.time + '</time></div>';
edition.speakers.forEach(fnCall);
html += colHtml + speakersContent + colHtmlClose;
html += '</div>';
});
return html;
}
function speakersRow(content) {
return '<div class="row">' + content + '</div>';
}
/**
* All stats including the current year
* @param json
* @returns {string}
*/
function allStats(json) {
var lives = [];
lives.push(statsResumed(json.virtual_schedule.youtube));
lives.push(statsResumed(json.virtual_schedule.instagram));
var fullStats = {
editions: lives
.map(c => c.editions)
.reduce((c, e) => c + e, 0),
speakers: lives
.map(c => c.speakers)
.reduce((c, e) => c + e, 0)
};
var result = '<p> O Happy Hour científico também está no Instagram e no YouTube. <br> ' +
'Já recebemos ' + fullStats.speakers.toString() + ' palestrantes em ' + fullStats.editions.toString() + ' lives do SciencePub!' + '</p>';
return result;
}
document.addEventListener("DOMContentLoaded", function (event) {
editionsElement = document.getElementById("spEditions");
instagramElement = document.getElementById("instagram");
youtubeElement = document.getElementById("youtube");
upcomingElement = document.getElementById("upcoming");
editionsDescription = document.getElementById("editions-description");
var pasthtml = '';
$.getJSON("data.json").done(function (json) {
var lives = [];
var youtube = json.virtual_schedule.youtube;
var instagram = json.virtual_schedule.instagram;
var upcoming = json.virtual_schedule.upcoming;
lives.push(statsResumed(json.virtual_schedule.youtube));
lives.push(statsResumed(json.virtual_schedule.instagram));
var fullStats = {
editions: lives
.map(c => c.editions)
.reduce((c, e) => c + e, 0),
speakers: lives
.map(c => c.speakers)
.reduce((c, e) => c + e, 0)
};
instagramElement.innerHTML = buildScheduleItens(json.virtual_schedule.instagram);
youtubeElement.innerHTML = buildScheduleItens(json.virtual_schedule.youtube);
upcomingElement.innerHTML = buildScheduleItens(json.virtual_schedule.upcoming.reverse());
editionsDescription.innerHTML = allStats(json);
});
});
</script>
</html>