-
Notifications
You must be signed in to change notification settings - Fork 19
/
app.js
58 lines (52 loc) · 1.4 KB
/
app.js
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
function fillCss() {
const children = document.getElementById('contributors').childNodes;
children.forEach((child, id) => {
if (child.tagName == 'DIV') {
child.className = `
column
is-half-tablet
is-three-quarters-mobile
is-one-quarter-fullhd
is-one-third-widescreen
has-text-centered
`;
let i = 0;
let len = child.childNodes.length,
box = child.childNodes[i];
while (++i < len && box.tagName != 'DIV') {
box = child.childNodes[i];
}
if (box.tagName == 'DIV') {
box.className = `
box
is-flex
is-justify-content-space-between
is-align-items-center
`;
let pChilds = box.childNodes,
x = 0;
let p = pChilds[x];
pLen = pChilds.length;
while (++x < pLen && p.tagName != 'SPAN') {
p = pChilds[x];
}
len = p.childNodes.length;
for (let j = 0, k = 0; j < len; j++) {
if (p.childNodes[j].tagName == 'P') {
if (k == 0) {
p.childNodes[j].className = `title is-5`;
k++;
} else if (k == 1) {
p.childNodes[j].className = `subtitle is-6`;
} else {
break;
}
}
}
}
}
});
}
document.addEventListener('DOMContentLoaded', event => {
document.addEventListener('load', fillCss());
});