Skip to content

Week 7: GitHub Tracker by Elsa Carlström#39

Open
elsisco wants to merge 15 commits intoTechnigo:mainfrom
elsisco:main
Open

Week 7: GitHub Tracker by Elsa Carlström#39
elsisco wants to merge 15 commits intoTechnigo:mainfrom
elsisco:main

Conversation

@elsisco
Copy link
Copy Markdown

@elsisco elsisco commented Oct 3, 2021

Had a lot of fun with this project. I'm quite proud of the language-o-meter and the over-all design :)

Copy link
Copy Markdown

@JuliaNiki JuliaNiki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great project, Elsa! I see that you understand very well the positioning of elements and how to style a webpage correctly with both CSS and JavaScript.
One note would be to think about position of the chart on mobile view, it is really small and it would be challenging for someone outside Technigo to understand it without labels for colors (how many projects are done and left). Very nice styling though, I love it!


This project opened up my eyes to the clever use of dynamic id's. By using it I was able to keep the functions separate and invoking them with arguments in the main function (getRepos) instead of having to collect them all in the main function in a "waterfall" structure to access the values of the variables inside.

Next step would be to add if the projects has collaborators or not (group or individual assignment), names of collaborators and the commits made for projects I've been a collaborator on. To be able to sort and/or search for the projects will come in handy when the number of projects will increase.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great ideas for the future and nice touch that you fixed some extra features, especially language percentage display is impressive!

Comment on lines +96 to +115
const calculateLanguagePercentage = (repo) => {
fetch(`https://api.github.com/repos/${USER}/${repo.name}/languages`)
.then(res => res.json())
.then(language => {
const html = language.HTML || 0;
const css = language.CSS || 0;
const js = language.JavaScript || 0;
const sum = html + css + js;

const htmlPercentage = ((html / sum) * 100).toFixed(1);
const cssPercentage = ((css / sum) * 100).toFixed(1);
const jsPercentage = ((js / sum) * 100).toFixed(1);

document.getElementById(`progress-${repo.name}`).innerHTML = /*html*/ `
<div class="progress-html" style="width:${htmlPercentage}%;"></div>
<div class="progress-css" style="width:${cssPercentage}%;"></div>
<div class="progress-js" style="width:${jsPercentage}%;"></div>
`
})
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, really nice approach and result! I am glad I could see it and learn more about fetching languages :)

code/style.css Outdated
width: 100%;
height: 100%;
margin: 0;
background-image: url('./assets/background.png');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a very nice background image!

.profile-wrapper {
background-color: rgba(255, 255, 255, 0.5);
text-align: center;
margin: 15px auto;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to your project I really noticed how handy it is to use these values of margin and will apply it to my future projects, thank you!

<p class="links-text"><a href="${repo.html_url}">GitHub repository ➔</a> | <a href="${repo.homepage}">View it live ➔</a></p>
<p class="text">Most recent edit: ${latestCommit}</p>
<p class="text">Default branch: ${repo.default_branch}</p>
<p id="commits-${repo.name}" class="text">(commits yet to be displayed)</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good touch that you did not need to make an if else statement for cases when commit messages were not displayed, and you found that way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants