Skip to content

Commit 4b1bcf9

Browse files
Camilla HallbergCamilla Hallberg
authored andcommitted
small changes to all files
1 parent beea044 commit 4b1bcf9

3 files changed

Lines changed: 43 additions & 22 deletions

File tree

code/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ <h1>GitHub Tracker</h1>
2020
<section class="userData" id="userData"></section>
2121

2222
<main id="projects">
23-
<h2>&#128071;&#127997; Projects &#128071;&#127997;</h2>
23+
<h2>&#128071;&#127997; Technigo Projects &#128071;&#127997;</h2>
2424
</main>
25-
25+
2626
<!-- This will be used to draw the chart 👇 -->
2727
<canvas id="chart"></canvas>
2828

code/script.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ fetch(API_USER, options)
2525
.then(user => {
2626
console.log(user, 'my user');
2727
userData.innerHTML = `
28-
<div class="info">
28+
<div class="avatar">
2929
<img class="img" src="${user.avatar_url}" alt="user image">
30+
</div>
31+
<div class="info">
3032
<h3>${user.login}</h3>
3133
<h4>${user.bio}</h4>
3234
<h4>Location: ${user.location}</h4>
@@ -48,39 +50,41 @@ const getRepos = () => {
4850
forkedRepos.forEach((repo) => {
4951
projectsContainer.innerHTML += `
5052
<div class="projects-card" id="${repo.id}">
51-
<h3><a href="${repo.html_url}">${repo.name}</a> - ${repo.default_branch}</h3>
53+
<h3><a href="${repo.html_url}">${repo.name}</a></h3>
54+
<p class="default-branch">Branch: ${repo.default_branch}</p>
5255
<p>Latest push: ${new Date(repo.pushed_at).toDateString()}</p>
5356
<p id="commit_${repo.name}">Number of commits:</p>
5457
<p>Main language: ${repo.language}</p>
5558
</div>
5659
`
5760
})
58-
5961
getPullRequests(forkedRepos)
6062
})
6163
}
6264

65+
getRepos()
66+
6367
const getPullRequests = (forkedRepos) => {
6468
forkedRepos.forEach(repo => {
6569
fetch(`https://api.github.com/repos/technigo/${repo.name}/pulls?per_page=150`, options)
6670
.then(res => res.json())
6771
.then(data => {
6872
const commits = document.getElementById(`commit-${repo.name}`)
6973

70-
const pulls = data.find((pull) => pull.user.login === repo.owner.login)
74+
const pulls = data.find((pull) => pull.user.login === repo.owner.login);
7175

7276
getCommits(pulls.commits_url, repo.name)
7377
console.log(pulls.commits_url)
7478
})
7579
})
7680
}
7781

78-
const getCommits = (myCommitsURL, myReposName) => {
79-
fetch(myCommitsURL, options)
80-
.then(res => res.json())
81-
.then(data => {
82-
document.getElementById(`commit-${myReposName}`).innerHTML += data.length
82+
const getCommits = (myCommitsUrl, myRepoName) => {
83+
fetch(myCommitsUrl, options)
84+
.then((res) => {
85+
return res.json()
8386
})
84-
}
85-
86-
getRepos()
87+
.then((data) => {
88+
document.getElementById(`commit-${myRepoName}`).innerHTML += data.length
89+
})
90+
}

code/style.css

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
body {
2-
background: linear-gradient(floralwhite, rosybrown);
2+
background: linear-gradient(rosybrown, floralwhite);
33
}
44

55
h1 {
@@ -15,6 +15,7 @@ h2 {
1515
font-size: 32px;
1616
color:mediumpurple;
1717
text-align: center;
18+
cursor: pointer;
1819
}
1920

2021
h3 {
@@ -29,22 +30,38 @@ h4 {
2930
color: whitesmoke;
3031
}
3132

32-
.info {
33-
display: flex;
34-
flex-direction: column;
35-
text-align: center;
36-
}
37-
3833
.img {
3934
width: 96px;
4035
border-radius: 50%;
4136
border: 8px solid floralwhite;
4237
}
4338

39+
.info {
40+
text-align: center;
41+
}
42+
43+
.projects-card {
44+
background: linen;
45+
border: 6px solid hotpink;
46+
margin: 12px;
47+
padding: 12px;
48+
font-size: 12px;
49+
font-family: 'Shippori Antique B1', sans-serif;
50+
text-align: center;
51+
}
52+
53+
.default-branch {
54+
font-family: 'Shizuru', cursive;
55+
}
56+
57+
a {
58+
color: black;
59+
}
60+
4461
/* Footer Styling */
4562
.made-by {
4663
font-family: 'Shippori Antique B1', sans-serif;
4764
font-size: 12px;
48-
color:lavenderblush;
65+
color: #694E4E;
4966
text-align: center;
5067
}

0 commit comments

Comments
 (0)