-
Notifications
You must be signed in to change notification settings - Fork 1
/
credits.html
156 lines (124 loc) · 7.04 KB
/
credits.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>credits</title>
<!-- Add icon library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./shared/bootstrap.min.css">
<script src="./shared/jquery-3.6.1.min.js"></script>
<script src="./shared/bootstrap.bundle.min.js" defer></script>
<link rel="stylesheet" href="./shared/styles.css">
</head>
<body>
<div class="main">
<!-- no special charater allowed for contributor.name -->
<div id="credits_container" class="accordion" style="color: white;max-height: 100%;overflow-y: scroll"></div>
</div>
<div id="cns_wrapper" class="">
<div id="cns" class="">
BACK
<a href="./" class="reimu_back"> <img src="./img/reimu_back3.png"> </a>
</div>
</div>
<script>
fetch("./data/credits/credits.json")
.then(response => response.json())
.then(data => {
const departments = data['departments'];
departments.map(department => {
$('#credits_container')
.append(
$('<div class="mb-4">'
+ '<button class="btn btn-light" type="button" data-toggle="collapse" '
+ 'data-target="#' + department.department + '" aria-expanded="false" aria-controls="collapseTwo">'
+ '<h4>' + department.department.replaceAll('_', ' ') + ' ( click to fold/unfold )</h4></button>'
+ '<div>')
)
.append(
$('<div>'
+ '</div>')
.addClass('credit_department collapse ' +
(['Site_-_Management', 'CONNECTING_-_Project_Lead_and_Project_Manager'].includes(department.department) ? 'show' : 'collapsed')
)
.attr({ 'id': department.department, "data-parent": "#credits_container" })
.css({
'display': 'flexbox'
})
);
department['contributors'].map(contributor => { // like cards
$('#' + department.department)
.css({
'margin': '20px'
})
.append(
$('<div></div>')
.addClass('credits_contributor_container').css({
'margin': '10px',
'text-align': 'center',
'display': 'inline-table',
'padding': '10px',
'width': contributor.pfp && '290px',
"background-size": 'contain',
'background-repeat': 'no-repeat',
'background-position': 'center',
'border': 'solid 3px white',
// 'border': 'solid 3px ' + (contributor.border ? 'none' : 'white'),
'background-color': contributor.name == 'Bettiepop' && contributor.bgcolor,
'background-image': contributor.name == 'Bettiepop' && 'url("' + data['pfp_paths'] + contributor.bgimg + '")',
})
.append(
$('<div></div>').css({
'padding': '10px',
// 'border': 'solid 5px ' + contributor.border,
})
.append(
$('<div></div>')
.addClass('credits_contributor_pfp')
.css(
{
'margin': 'auto',
'border-radius': '50%',
'height': contributor.pfp && '100px',
'width': '100px',
'background-image': 'url("' + data['pfp_paths'] + contributor.pfp + '")',
'background-repeat': 'no-repeat',
'background-size': '100px'
}
)
)
.append(
$('<div><h4>' + contributor.name + '<h4/></div>')
.addClass('credits_contributor_name')
)
.append(
$('<div></div>')
.addClass('credits_contributor_intro')
.append(contributor['intro'])
)
.append(
$('<div></div>')
.addClass('credits_contributor_contacts')
.attr('id', contributor.name.replaceAll(' ', '_'))
)
)
);
contributor['contacts'].map(contact => {
$('#' + contributor.name.replaceAll(' ', '_'))
.append(
$('<a></a>')
.addClass('fa fa-' + contact['platform'])
.attr({ 'href': contact['href'], "target": "_blank" })
.css({
'margin': '5px',
})
)
})
})
})
});
</script>
</body>
</html>