Skip to content

Commit a621f24

Browse files
committed
feat: update project card adding script
1 parent bc84961 commit a621f24

File tree

3 files changed

+20
-14
lines changed

3 files changed

+20
-14
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ <h2 class="text-primary">Our Vision</h2>
105105
<section id="projects" class="projects">
106106
<h2>Projects</h2>
107107

108-
<div class="flex-col-2 flex-items" id="githubprojects">
108+
<div class="flex-col-2" id="githubprojects">
109109
<!-- GitHub Projects from scripts.js goes here -->
110110
</div>
111111

src/assets/css/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ nav ul li a:focus {
241241

242242
.project {
243243
padding: 40px;
244+
margin-bottom: 2rem;
244245
background: #fff url(../images/under-construction.png) no-repeat center
245246
center/cover;
246247
}

src/assets/javascript/script.js

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,47 @@ navToggle();
3030
var githubprojectsdomelement = document.getElementById('githubprojects');
3131

3232
let githubprojects = [
33-
{
34-
name: 'chryz-hub/chryz-hub.github.io',
35-
icon: 'description',
36-
},
33+
{
34+
name: 'chryz-hub/chryz-hub.github.io',
35+
}, {
36+
name: 'chryz-hub/opensource-4-everyone',
37+
}, {
38+
name: 'chryz-hub/top-languages-cheat',
39+
}, {
40+
name: 'chryz-hub/web-dev-resources',
41+
},
3742
// Here can be added some more projets if needed
3843
];
3944

4045
githubprojects.forEach((project) => {
41-
getproject(project.name, project.icon);
46+
getproject(project.name);
4247
});
4348

44-
function getproject(project, icon) {
49+
function getproject(project) {
4550
fetch(`https://api.github.com/repos/${project}`)
4651
.then((response) => {
4752
return response.json();
4853
})
4954
.then((project) => {
5055
// we add the project card directly to the html dom
51-
githubprojectsdomelement.innerHTML += createprojectcard(project, icon);
56+
githubprojectsdomelement.innerHTML += createprojectcard(project);
5257
});
5358
}
5459

55-
function createprojectcard(project, icon) {
60+
function createprojectcard(project) {
5661
// removing github emojis cause they are not usable in html
5762
project.description = project.description.replace(/:[^}]*:/, '');
5863

5964
// TODO: add Project Card
6065
let projectcard = `<a href="#">
6166
<div class="item project">
62-
<h4 class="text-secondary">Chryz-Hub Website</h4>
63-
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quis quos consequatur atque perferendis
64-
sapiente consectetur iusto tempora temporibus, sequi maxime.</p>
67+
<h4 class="text-secondary">${project.name}</h4>
68+
<p>${project.description}</p>
6569
<div>
66-
<span class="fab fa-html5"></span>
70+
<!-- TODO add icons -->
71+
<!-- <span class="fab fa-html5"></span>
6772
<span class="fab fa-css3-alt"></span>
68-
<span class="fab fa-js"></span>
73+
<span class="fab fa-js"></span> -->
6974
</div>
7075
</div>
7176
</a>`;

0 commit comments

Comments
 (0)