-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
599 lines (514 loc) · 20.7 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
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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
<!DOCTYPE html>
<html>
<head>
<title>Brainhack Proceedings</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900|Material+Icons" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;700&display=swap" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/quasar.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/@quasar/[email protected]/dist/index.min.css" rel="stylesheet" type="text/css">
<!-- <link
rel="icon"
sizes="any"
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='5' fill='rgb(102, 143, 166)'/%3E%3C/svg%3E"
> -->
<link rel='shortcut icon' type='image/x-icon' href="/favicon.svg" />
<style>
[v-cloak] {display: none}
.my-logo-font {
font-family: 'Roboto Condensed', sans-serif;
}
.my-font {
font-family: 'Roboto', sans-serif;
}
.box-shadow:hover {
box-shadow: 3px 3px 3px rgba(0,0,0,0.2) !important;
}
.intro {
background: url(/img/pattern1.png);
background-size: cover;
background-position: 50%;
background-attachment: fixed;
background-repeat: no-repeat;
}
.custom_tab {
width: 80px;
min-height:50px !important;
color: white
}
</style>
<style>
html, body {
margin:0;
}
.b {
fill: rgb(59,81,94);
}
.a {
fill: rgba(83,91,96,0.5);
}
</style>
<script>
window.quasarConfig = {
brand: {
primary: '#f0f0f0',
secondary: '#26A69A',
accent: '#668fa6',
dark: 'rgb(66,67,68)',
positive: '#21BA45',
negative: '#C10015',
info: '#31CCEC',
warning: '#F2C037'
}
}
</script>
</head>
<body>
<div id="q-app">
<q-layout v-cloak view="lHh lpr lFf">
<!-- header -->
<q-header v-model="headerState" v-scroll="scrollFunction" class="q-py-none bg-dark" >
<q-toolbar class="items-bottom">
<a href="/" style="text-decoration: none;" class="text-white">
<span
style="font-size: 31px;margin-left:30px"
class="my-logo-font text-h6 text-white text-weight-bolder"
>BRAINHACK</span><span
:style="'font-size: 31px;'"
class="my-font text-h6 q-mr-md text-weight-light"
>Proceedings</span>
</a>
<q-space></q-space>
<q-tabs no-caps q-pb-none >
<!-- <q-tab
class="q-mr-sm q-pb-none q-my-none custom_tab" @click="scrollToElement('id_about');"
label="About" >
</q-tab> -->
<q-tab
class="q-mr-sm q-pb-none q-my-none custom_tab" @click="goTo('/about')"
label="About" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/papers')"
label="Papers" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('https://brainhack-proceedings.readthedocs.io/en/latest/')"
label="Doc" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/submit')"
label="Submit" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/review')"
label="Review" >
</q-tab>
</q-tabs>
</q-toolbar>
</q-header>
<q-page-container>
<q-page>
<!-- Header landing -->
<div class="q-pa-none q-ma-none bg-dark" style="z-index:10px;">
<div class="q-pa-none q-ma-none bg-dark" >
<svg style="width:100%;height:200px"></svg>
<q-toolbar class="items-bottom">
<a href="/" style="text-decoration: none;" class="text-white">
<span
style="font-size: 31px;margin-left:30px"
class="my-logo-font text-h6 text-white text-weight-bolder"
>BRAINHACK</span><span
:style="'font-size: 31px;'"
class="my-font text-h6 q-mr-md text-weight-light"
>Proceedings</span>
</a>
<q-space></q-space>
<q-tabs no-caps q-pb-none >
<q-tab
class="q-mr-sm q-pb-none q-my-none custom_tab" @click="goTo('/about');"
label="About" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/papers')"
label="Papers" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('https://brainhack-proceedings.readthedocs.io/en/latest/')"
label="Doc" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/submit')"
label="Submit" >
</q-tab>
<q-tab
class="q-mr-sm q-pb-none custom_tab" @click="goTo('/review')"
label="Review" >
</q-tab>
</q-tabs>
</q-toolbar>
</div>
</div>
<!-- About section -->
<div class="q-px-md bg-primary" >
<div class="q-px-xl q-pt-xl bg-primary" id="id_about" >
<!-- Text part 1 -->
<div class="row justify-left" >
<div class="col-md-1" ></div>
<div class="q-pt-xl col-12 col-lg-6 col-md-9" >
<span class="text-left text-grey-10" style="font-size: 36px;">Brainhack Proceedings. An open & free journal for Brainhack project outcomes.
</span>
</div>
<div class="col-md-2" ></div>
</div>
<!-- Text part 2 -->
<div class="q-pb-md row justify-left">
<div class="col-md-1"></div>
<div class="q-py-sm col-12 col-lg-6 col-md-9">
<span class="text-center text-grey-10 text-h5 text-weight-light">Brainhack Proceedings is a community-driven, open access and free publication platform of short reports for Hackathon, Outcomes, Project, and Education (HOPE) objects!</span>
</div>
<div class="col-md-2"></div>
</div>
<!-- 2 buttons -->
<div class="row justify-left">
<div class="col-md-1"></div>
<div class="col-12 col-lg-6 col-md-9 text-left">
<q-btn flat dense no-caps class="text-weight-regular q-mr-lg q-px-md q-py-none" type="a" href="/submit" size="lg"
:style="'background:'+ theme_color +'; color: white; font-size: 21px;'" label="Submit a paper" >
</q-btn>
<q-btn flat dense no-caps class="text-weight-regular q-px-md q-py-none" type="a" href="/review" size="lg"
:style="'background:'+ theme_color +'; color: white'" label="Volunteer to review" >
</q-btn>
</div>
<div class="col-12 col-md-2"></div>
</div>
</div>
</div>
<!-- Recently published papers -->
<div class="q-px-md bg-primary" >
<div class="q-px-xl q-pt-sm bg-primary" id="id_recentpapers" >
<!-- Headline section -->
<div class="row justify-left" >
<div class="col-md-1" ></div>
<div class="q-pt-xl col-12 col-lg-6 col-md-9" >
<h5 class="text-left text-grey-10 text-weight-bold" style="font-size: 21px !important;">Recently published Papers
</h5>
</div>
<div class="col-md-1" ></div>
</div>
<!-- Recent papers -->
<div v-for="paper in papers">
<div class="row justify-center">
<div class="q-py-sm col-12 col-lg-10 col-md-10">
<q-card inline style="border: none;"
class="text-left box-shadow" flat bordered>
<q-card-section class="text-left">
<div class="row">
<div class="col-7 q-pl-md q-pr-lg">
<div class="row">
<q-chip square size="sm">
{{paper.publishStatus}}
</q-chip>
<span class="text-caption text-weight-light q-pa-xs" >
{{paper.date}}
</span>
</div>
<div class="row">
<div :class="paper_heading_1" :style="'color: ' + paper_heading_color_1"
class="paper_heading_1 text-h6 q-mt-sm q-mb-xs"> <a
:href="'https://brainhack-proceedings.github.io/' + paper.url"
target="_blank"
style="color: #4b4f51; text-decoration: none;"
>{{paper.title}}</a>
</div>
</div>
<div class="row">
<div class="text-caption text-grey-10 q-mt-sm">
{{paper.authors}}
</div>
</div>
</div>
<div class="col-4 q-py-md q-pl-lg q-pr-md">
<div class="row q-pb-xs">
<q-img style="height: 50px;width:50px;" :src="paper.githubAvatar" >
</q-img>
</div>
<div class="row q-py-xs">
<!-- <a :href="'https:doi.org/' + paper.doi" target="_blank" style="color: #4b4f51; text-decoration: none;">doi: {{paper.doi}}</a> -->
<a
:href="'https://brainhack-proceedings.github.io/' + paper.url"
target="_blank"
style="color: #4b4f51; text-decoration: none;"
>https://brainhack-proceedings.github.io/{{paper.url}}</a>
</div>
</div>
</div>
</q-card-section>
</q-card>
</div>
</div>
</div>
<div class="q-py-xl row text-center justify-center text-h5 text-weight-light" style="text-decoration: none; ">
<span style="text-decoration: none;"><a style="text-decoration: none; color: #4b4f51; font-size: 21px;" href="https://brainhack-proceedings.github.io/papers" >View all papers...</a></span>
</div>
</div>
</div>
<!-- footer -->
<q-toolbar class="flex flex-center text-white text-center bg-dark q-py-xl"
:style="'border-top: 5px solid ' + bg_color">
<div class="q-pa-sm q-gutter-sm">
<q-btn round type="a" href="https://twitter.com/brainhackorg"
:style="'background:'+ theme_color +'; color: white !important;'" icon="fab fa-twitter" >
</q-btn>
<q-btn round type="a" href="https://github.com/brainhack-proceedings"
:style="'background:'+ theme_color +'; color: white !important;'" icon="fab fa-github" >
</q-btn>
<q-btn round type="a" href="mailto:[email protected]"
:style="'background:'+ theme_color +'; color: white !important;'" icon="email" >
</q-btn>
Made with ❤ Brainhack Proceedings CC BY 4.0 <br/>
</div>
</q-toolbar>
</q-page>
</q-page-container>
</q-layout>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@^2.0.0/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/quasar.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@quasar/[email protected]/dist/index.umd.min.js"></script>
<script>
const { getScrollTarget, setScrollPosition } = Quasar.scroll
async function getPapers(url) {
const res = await fetch(url);
const list = await res.json();
return list.items;
// const filename = "repos.json";
// var csvData = 'data:text/ascii;charset=utf-8,'+encodeURIComponent(JSON.stringify(list));
// var a = document.createElement('a');
// a.href = csvData;
// a.download = filename;
// document.body.appendChild(a);
// a.click();
}
async function readPapers() {
const res = await fetch("repos.json");
const list = await res.json();
return list;
}
function parsePaper(md) {
const lines = md.split("\n");
const title = lines
.filter((line)=>(line.match("title:")))[0]
.match(/'([^']*)'/)[1];
const doi = "10001.1001";
// const doi = lines
// .filter((line)=>(line.match("gigascience-ref:")))[0]
// .match(/{doi:([^}]+)}/)[1];
const lastnames = lines
.filter((line)=>(line.match(" surname: ")))
.map((str) => str.match(/ surname: (.*)/)[1]);
const firstnames = lines
.filter((line)=>(line.match(" firstname: ")))
.map((str) => str.match(/ firstname: (.*)/)[1]);
const arr = [];
for(let i=0;i<firstnames.length;i++) {
arr.push(`${firstnames[i]} ${lastnames[i]}`);
}
const authors = arr.join(", ");
return {title, doi, authors};
}
// async function getPaperPath(repoOwner, repoName) {
// const url = `https://api.github.com/search/code?q=title+repo:${repoOwner}/${repoName}+filename:brainhack-report.md`;
// const res = await fetch(url);
// const info = res.json();
// const path = info.items[0].path;
// return path;
// }
// async function getPaper(repoOwner, repoName, path) {
// const mdurl = `https://raw.githubusercontent.com/${repoOwner}/${repoName}/${path}`;
// const res = await fetch(mdurl);
// const md = await res.text();
// return md;
// }
async function getPaper(repoURL) {
const url = repoURL.replace("https://github.com/","https://raw.githubusercontent.com/");
let res;
let md;
res = await fetch(url + '/master/report.md');
if(res.status === 404) {
res = await fetch(url + '/main/report.md');
}
try {
md = await res.text();
} catch (err) {
throw new Error(err);
}
return md;
}
async function readPaper() {
const res = await fetch("paper.md");
const md = await res.text();
return md;
}
function parseRepo(info) {
const date = info.pushed_at;
const format = new Intl.DateTimeFormat('en', { year: 'numeric', month: 'short', day: '2-digit' });
const [{ value: month },,{ value: day },,{ value: year }] = format.formatToParts(new Date(date));
const githubRepo = info.html_url;
let githubAvatar = "";
if(typeof info.parent !== "undefined") {
githubAvatar = info.parent.owner.avatar_url;
} else {
githubAvatar = info.owner.avatar_url;
}
return {githubRepo, githubAvatar, year, month, day};
}
async function getRepo(url) {
const apiurl = url.replace("github.com","api.github.com/repos");
const res = await fetch(apiurl);
const info = await res.json();
return info;
// const filename = "repo.json";
// var csvData = 'data:text/ascii;charset=utf-8,'+encodeURIComponent(JSON.stringify(info));
// var a = document.createElement('a');
// a.href = csvData;
// a.download = filename;
// document.body.appendChild(a);
// a.click();
}
async function readRepo(url) {
const res = await fetch(url);
const info = await res.json();
return info;
}
async function collectPapers() {
// const list = await getPapers("https://api.github.com/users/Brainhack-Proceedings-2015/repos");
const list = await getPapers("https://api.github.com/search/repositories?q=topic:brainhack-proceeding-report fork:true user:brainhack-proceedings");
for(let i=0;i<list.length;i++) {
// const repoOwner = list[i].owner.login;
// const repoName = list[i].name;
// const path = await getPaperPath(repoOwner, repoName);
// const md = await getPaper(repoOwner, repoName, path);
if(list[i].name === "template") {
continue;
}
try {
const md = await getPaper(list[i].html_url);
const {title, doi, authors} = parsePaper(md);
const info = await getRepo(list[i].html_url);
const {githubRepo, githubAvatar, year, month, day} = parseRepo(info);
app.papers.push({
publishStatus: "Published",
date: `${day} ${month} ${year}`,
url: list[i].name,
title, doi, authors, githubRepo, githubAvatar
})
console.log(`
title: ${title}
doi: ${doi}
authors: ${authors}
repo: ${githubRepo}
avatar: ${githubAvatar}
`);
} catch (err) {
// throw new Error(err);
console.log(err);
}
}
}
// getPapers("https://api.github.com/users/Brainhack-Proceedings-2015/repos");
// readPapers();
// readPaper();
// getRepo("https://api.github.com/repos/Brainhack-Proceedings-2015/Badhwar_HBM_Brainspell");
// readRepo("repo.json");
app = new Vue({
el: "#q-app",
data() {
return {
selected_tab: 't_0',
bg_color: '#4b4f51',
hover: false,
active: false,
theme_color: '#668fa6',
background_style: '#668fa6',
paper_heading_1: [],
paper_heading_color_1: '#4b4f51',
headerState: false,
papers: []
}
},
methods: {
scrollToElement(id) {
let el = document.getElementById(id)
const target = getScrollTarget(el)
const offset = el.offsetTop + 3
const duration = 900
setScrollPosition(target, offset, duration)
},
goTo(url){
window.location.href = url;
},
unhideHeader() {
let scrollPos=0;
// scrollPos = getScrollPosition('#id_about');
if(Quasar.scroll) {
scrollPos+=1;
console.log(scrollPos);
// headerState=true;
}
},
scrollFunction (pos) {
this.headerState = (pos>300);
}
}
});
collectPapers();
</script>
<script>
const svg = document.querySelector("svg");
const roundToOdd = (n) => 2 * Math.floor(n / 2) + 1;
const margin = 40;
const nrows = 4;
const rToRmin = 0.25;
const rProportion = 0.7;
const colProportion = [
[500, 11],
[1600, 33],
]
const sizeDelta = colProportion[1][0] - colProportion[0][0];
const colsDelta = colProportion[1][1] - colProportion[0][1];
const a = colsDelta / sizeDelta;
const b = colProportion[0][1] - (a * colProportion[0][0]);
const draw = () => {
const width = window.innerWidth - (margin * 2);
const ncols = roundToOdd(a * width + b);
const col = width / ncols;
const r = (col / 2) * rProportion;
const minr = r * rToRmin;
const rprop = r / minr;
const rdisp = (minr * (rprop - 1)) / 2
const height = nrows * col - r / 2 + margin * 1.5;
svg.innerHTML = '';
svg.style.height = height;
let innerHTML = '';
for(let i = 0; i < ncols; i++) {
const p1 = ((ncols - 1 - i) / ncols);
const p2 = (i / ncols);
const r1 = r * p2 + minr * p1;
const r2 = r * p1 + minr * p2;
const x = (i * col) + r + margin;
const x1 = x - rdisp;
for(let j = 0; j < nrows; j++) {
const x2 = x + rdisp;
const y = j * col + r + margin;
innerHTML += `<circle class="b" cx="${x2}" cy="${y}" r="${r2}" /> `;
innerHTML += `<circle class="a" cx="${x1}" cy="${y}" r="${r1}" /> `;
}
}
svg.innerHTML = innerHTML;
}
window.addEventListener('resize', draw);
draw();
</script>
</body>
</html>