-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
56 lines (45 loc) · 1.63 KB
/
scripts.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const LinksSocialMedia = {
github: 'luanbelon',
youtube: 'luanbelon',
facebook: 'luanbelon',
instagram: 'luanbelon',
twitter: 'oluanbelon'
}
function changeSocialMediaLinks() {
for (let li of socialLinks.children) {
const social = li.getAttribute('class')
li.children[0].href = `https://${social}.com/${LinksSocialMedia[social]}`
}
}
changeSocialMediaLinks()
function getGitHubProfileInfos() {
const url = `https://api.github.com/users/${LinksSocialMedia.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
})
}
getGitHubProfileInfos()
function activeGreenTheme(){
const mainContent = document.querySelector('main')
const buttonGreenTheme = document.querySelector('#green-theme')
const buttonDefaultTheme = document.querySelector('#default-theme')
mainContent.style.backgroundImage='url(img/green-theme.svg)'
mainContent.style.transitionDuration="2s"
buttonGreenTheme.style.display='none'
buttonDefaultTheme.style.display='block'
}
function activeDefaultTheme(){
const mainContent = document.querySelector('main')
const buttonGreenTheme = document.querySelector('#green-theme')
const buttonDefaultTheme = document.querySelector('#default-theme')
mainContent.style.backgroundImage='url(img/background.svg)'
mainContent.style.transitionDuration="2s"
buttonGreenTheme.style.display='block'
buttonDefaultTheme.style.display='none'
}