-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.js
More file actions
59 lines (37 loc) · 1.14 KB
/
ui.js
File metadata and controls
59 lines (37 loc) · 1.14 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class UI {
constructor() {
this.displayRepo = document.getElementById('displayRepo');
}
// Display Repo
showRepo(repo) {
let output = '';
repo.forEach(function (repo) {
output += `
<style>
#marginTop {
margin-top: 20px !important;
margin-bottom: 0px;
}
</style>
<div class="container">
<ul class="collection">
<li class="collection-item avatar">
<img src="${repo.owner.avatar_url}" class="circle">
<a href="${repo.html_url}" target="_blank" > <span class="title">${repo.name}</span> </a>
<p>${repo.description}</p>
<a href="#!" class="secondary-content"><i class="material-icons">grade</i>${repo.stargazers_count}</a>
<div id="marginTop" class="row">
<div class="col s1"><span class="new badge">${repo.language}</span></div>
<div class="col s6"><span class="badge">Updated: ${repo.updated_at}</span></div>
</div>
</li>
</ul>
</div>
`;
})
document.getElementById('displayRepo').innerHTML = output;
}
clearProfile() {
this.displayRepo.innerHTML = '';
}
}