Skip to content

Commit 7fd0a64

Browse files
committed
added media queries and updated readme
1 parent 763f814 commit 7fd0a64

File tree

3 files changed

+39
-22
lines changed

3 files changed

+39
-22
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ I've also learned how to do shading in css which was cool. Hopefully my javascri
1414

1515
## View it live
1616

17-
Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about.
17+
https://githubtracker-ninaalejandra.netlify.app/

code/script.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ const getUser = () => {
1717
profileInfo.innerHTML =
1818
`<img src="https://github.com/NinaAlejandra.png" alt="Profile picture">
1919
<h4> ${data.name}</h4>
20-
<h4> <a href="${data.html_url}">${data.login}</a></h4>`
21-
22-
})
20+
<h4> <a href="${data.html_url}">${data.login}</a></h4>`
21+
})
2322
}
2423

25-
//Fetch
24+
//Fetches
2625
const getRepos = () => {
2726
fetch(REPOS_URL)
2827
.then(response => response.json())
@@ -31,13 +30,13 @@ const getRepos = () => {
3130
const forkedRepos = data.filter(repo => repo.fork && repo.name.startsWith('project-'))
3231
const forkedSortedRepos = forkedRepos.sort(sortingFunctionFromStackOverflow)
3332
forkedSortedRepos.forEach(repo => list.innerHTML += `
34-
<div class="projects">
35-
<h3><a href="${repo.html_url}">${repo.name}
36-
with default branch ${repo.default_branch}</h3></a>
37-
<p>Recent push: ${new Date(repo.pushed_at).toDateString()}</p>
38-
<p id="pull-request-${repo.name}"></p>
39-
<p id="commits-${repo.name}"></p>
40-
</div>` )
33+
<div class="projects">
34+
<h3><a href="${repo.html_url}">${repo.name}
35+
with default branch ${repo.default_branch}</h3></a>
36+
<p>Recent push: ${new Date(repo.pushed_at).toDateString()}</p>
37+
<p id="pull-request-${repo.name}"></p>
38+
<p id="commits-${repo.name}"></p>
39+
</div>`)
4140
drawChart(forkedSortedRepos.length)
4241
fetchPullRequest(forkedSortedRepos)
4342
addCommits(forkedSortedRepos)
@@ -56,8 +55,6 @@ const fetchPullRequest = (allRepos) => {
5655
})
5756
}
5857

59-
60-
6158
const addCommits = (allRepos) => {
6259
allRepos.forEach(repo => {
6360
fetch(`https://api.github.com/repos/${USER}/${repo.name}/commits`)
@@ -70,8 +67,9 @@ const addCommits = (allRepos) => {
7067
}
7168

7269
function sortingFunctionFromStackOverflow(a, b) {
73-
// https://stackoverflow.com/questions/10123953/how-to-sort-an-object-array-by-date-property
7470
return new Date(a.created_at) - new Date(b.created_at)
7571
}
72+
73+
//invoking functions
7674
getUser()
7775
getRepos()

code/style.css

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ body {
22
background: #F7D4BC;
33
font-family: 'Gemunu Libre', sans-serif;
44
}
5-
header {
6-
text-align: center;
75

8-
font-size: 30px;
6+
header {
7+
text-align: center;
8+
font-size: 30px;
99
}
1010

1111
.profile {
@@ -16,9 +16,7 @@ font-size: 30px;
1616
color: #218380;
1717
margin:auto;
1818
width: 100%;
19-
flex-direction: column;
20-
21-
19+
flex-direction: column;
2220
}
2321

2422
img {
@@ -58,4 +56,25 @@ h4 {
5856
a {
5957
font-size: 18px;
6058
color: #218380;
61-
}
59+
}
60+
61+
@media (min-width: 668px){
62+
main {
63+
64+
text-align: center;
65+
flex-direction: row;
66+
}
67+
68+
.projects {
69+
display: inline-block;
70+
text-align: center;
71+
padding: 5px;
72+
width: 33%;
73+
height: 50%;
74+
}
75+
76+
.chart-class {
77+
width: 40%;
78+
margin-top: 20px;
79+
}
80+
}

0 commit comments

Comments
 (0)