-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (29 loc) · 1.18 KB
/
index.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
const getData = async () => {
const api = "https://api.github.com/repos/SWITCH-CLUB/ASCI-2021/contributors";
try {
let data = await fetch(api);
realData = await data.json();
// console.log(realData);
var html = '<div class="row">';
for (i = 0; i < realData.length; i++) {
if (i % 3 == 0 && i != 0) {
html += '</div>'
html += '<div class="row">'
}
html += `<div class="col-md-4 col-12">`;
html += `<div class=" card mt-5 card_red text-center">
<div class="title">
<img src="${realData[i].avatar_url}" alt="" id="imgbg" >
<div class="mt-3">
<h4>${realData[i].login}</h4>
<p class="commit">Total Commits-${realData[i].contributions}</>
<a href="${realData[i].html_url}">Github</a>
</div>
</div></div></div>`
}
$('#rowdy').append(html);
} catch (error) {
console.log(error);
}
};
getData();