Skip to content

Commit 822fac3

Browse files
Kara HowesKara Howes
authored andcommitted
added repo - names, branch and URL to cards
1 parent 4242999 commit 822fac3

2 files changed

Lines changed: 28 additions & 29 deletions

File tree

code/index.html

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,8 @@ <h2>Projects:</h2>
1616
<main id="projects">
1717

1818
</main>
19-
<section class="cards-container">
20-
<section class="html-card">
21-
<div class="card-projectname" id="cardProjectName">
22-
Project Name</div>
23-
<div class="updated" id="cardUpdated">
24-
Most recent update:
25-
</div>
26-
<div class= "branch" id="cardBranch">
27-
Name of default branch:
28-
</div>
29-
<div class= "URL" id="cardURL">
30-
URL:
31-
</div>
32-
<div class= "number-commits" id="cardCommits">
33-
Number of commit Messages:
34-
</div>
35-
<div class= "blank-line" id="cardBlank">
36-
blank
37-
</div>
38-
<div class= "blank-line" id="cardBlank">
39-
blank
40-
</div>
19+
<section class="cards-container" id="cards-container">
4120

42-
43-
</section>
4421
</section>
4522

4623
<!-- This will be used to draw the chart 👇 -->

code/script.js

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const USER = 'KaraHowes'
22
const repoURL = `https://api.github.com/users/${USER}/repos`
33
const projectsContainer = document.getElementById('projects')
4+
const cardsContainer = document.getElementById('cards-container')
45

56
const getRepos = ()=>{
67

@@ -10,18 +11,39 @@ const getRepos = ()=>{
1011
console.log(data)
1112
//projectsContainer.innerHTML = `The name of your first project was ${data[0].name}`
1213

13-
1414
const forkedProjects = data.filter(repo => repo.fork && repo.name.startsWith('project-'))
1515
forkedProjects.forEach(repo => projectsContainer.innerHTML += `<h3>${repo.name}</h3>`)
16+
17+
forkedProjects.forEach(repo => cardsContainer.innerHTML += `
18+
<section class="js-card">
19+
<div class="card-projectname" id="cardProjectName">
20+
Project Name: <span>${repo.name}</span></div>
21+
<div class="updated" id="cardUpdated">
22+
Most recent update:
23+
</div>
24+
<div class= "branch" id="cardBranch">
25+
Name of default branch: ${repo.default_branch}
26+
</div>
27+
<div class= "URL" id="cardURL">
28+
URL: ${repo.url}
29+
</div>
30+
<div class= "number-commits" id="cardCommits">
31+
Number of commit Messages:
32+
</div>
33+
<div class= "blank-line" id="cardBlank">
34+
blank
35+
</div>
36+
<div class= "blank-line" id="cardBlank">
37+
blank
38+
</div>
1639
40+
41+
</section>`)
42+
1743
drawChart(forkedProjects.length)
1844
console.log('hello', forkedProjects.length)
1945

20-
21-
2246
}
23-
24-
2547
)
2648
}
2749

0 commit comments

Comments
 (0)