-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
42 lines (31 loc) · 968 Bytes
/
Copy pathmain.js
File metadata and controls
42 lines (31 loc) · 968 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
/*
--- Anotações de Javascript ---
variável let permite modificações em seu valor;
variável const é uma variável que não pode ser modificada.
*/
const socialMedia = {
github: "danieomundo",
youtube: "channel/UC0QtiLHBqCprOq-6EddrSIg",
facebook: "danieomundo",
instagram: "ddans_",
twitter: "danieomundo"
}
function changesocialMedia() {
for (let li of socialLinks.children) {
const social = li.getAttribute('class')
li.children[0].href=`https://${social}.com/${socialMedia[social]}`
}
}
changesocialMedia()
function getGitHubInfos() {
const url = `https://api.github.com/users/${socialMedia.github}`
fetch(url).then(response => response.json())
.then(data => {
userName.textContent = data.name
userBio.textContent = data.bio
userLink.href = data.html_url
userImage.src = data.avatar_url
userLogin.textContent = data.login
})
}
getGitHubInfos()