-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (36 loc) · 1.15 KB
/
index.html
File metadata and controls
43 lines (36 loc) · 1.15 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="style.css">
<title>Basic Layout Web</title>
</head>
<body>
<h1>Hello Ges</h1>
<p>Task 1 SCC 2020</p>
<br><br>
<div class="box" id="imaget"></div>
<script>
async function get() {
const res = await fetch(
'https://api.github.com/repos/rafiudd/basic-layout-web/contributors',
);
const data = await res.json();
console.log(data);
let img = document.getElementById('imaget');
for (let i = 0; i < data.length; i++) {
let listName = '';
let listImg = '';
let listData = data[i];
let {login: user, avatar_url: imgUser} = listData;
listName += `<h3>${user}</h3>"`;
listImg += `<a href="https://rafiudd.github.io/basic-layout-web/${user}" ><img src="${imgUser}"></a>`;
img.innerHTML += listImg;
}
}
window.onload = get();
</script>
</body>
</html>