-
Notifications
You must be signed in to change notification settings - Fork 23
/
script.js
36 lines (26 loc) · 1.09 KB
/
script.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
let users = fetch("./contributors.json").
then(response => response.json()).
then(data => {
let users = data.profiles;
let element = users.map((user) => (
`<div class="contributor">
<div class="head-contributor">
<img src=${user.avatarUrl} alt=${user.avatarUrl} width="250px">
</div>
<div class="body-contribute">
<div class="name">${user.name}</div>
<div class="socials">
<a href='https://github.com/${user.github}'><i class="fa-brands fa-github github"></i></a>
<a href='https://twitter.com/${user.twitter}'><i class="fa-brands fa-twitter twitter"></i></a>
</div>
</div>
</div>`
))
let child = document.createElement('div');
child.className = 'contributors'
child.innerHTML = element;
let contributors = document.querySelector('.mapping-contributors');
contributors.appendChild(child);
return data;
}
)