-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUI.js
More file actions
50 lines (42 loc) · 959 Bytes
/
Copy pathUI.js
File metadata and controls
50 lines (42 loc) · 959 Bytes
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
class UI {
constructor() {
this.prof=document.getElementById('profileInfo');
}
display({
// Receive object destructuring data as parameter
profile_pic,
profile_url,
name,
message,
bio,
}){
const template=`<div id="cardImage">
<img class="round" src=${profile_pic} alt="Profile pic not found">
</div>
<div class="cardBody">
<div id="cardDetail">
<div class="name">
<h2>${name}</h2>
</div>
<div class="bio">
<h3>Bio: ${bio}.
</h3>
</div>
<button class="btn">
<a href=${profile_url} class="link" target=”_blank”>Profile url</a>
</button>
</div>
</div>`;
console.log(profile_url);
if(message=='Not Found')
{
this.prof.innerHTML="Profile Not Found";
}
else
{
var v=document.getElementById('profileInfo');
v.style.visibility = 'visible';
this.prof.innerHTML=template;
}
}
}