-
Notifications
You must be signed in to change notification settings - Fork 0
Homework week2 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
homework/style.css
Outdated
| margin-left: 2px; | ||
|
|
||
| display: grid; | ||
| grid-template-columns: 33.3333% 33.3333% 33.3333%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably better to use flex-sizing here: grid-template-columns: 1fr 1fr 1fr; (three columns with the same flex factor = the same width)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thank you :)
homework/style.css
Outdated
| box-shadow: 10px 5px 5px grey; | ||
| } | ||
| span { | ||
| display: row; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think display: row; exists. You're probably looking for display: block;, but if you're doing that you should probably use a div instead of span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or are you trying do make the span behave like a table, in that case it's display: table-row;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried 'millions' of options looking for a way to display the contributions block in three columns having picture, name and number in separate rows. Gave it up for now since the focus is the js anyway :))
homework/index.js
Outdated
| .then((contribData) => { | ||
| contribData.forEach(contributor => { | ||
| // createAndAppend('p', contribs, { text: 'hej'}); | ||
| createAndAppend('img', contribs, { src: contributor.avatar_url, height: 40, class: 'picture' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in week 1 I'm not a fan of this html structure as it doesn't provide any clue how to group the items. See linked comment for more details.
|
|
||
| box-shadow: 10px 5px 5px grey; | ||
| } | ||
| #forContributorsBlock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm kind of following what you want to do here, but would prefer another solution (this one doesn't use semantic html and isn't easy to understand):
I'm assuming a html-strucuture like this:
<div class="container contributors">
<h2>Contributors</h2>
<ul class="forContributorsBlock">
<li class="contributor">
<a href="...">contributor name</a>
<img src="..." />
<span>5</span>
</li>
</ul>
</div>.contributors {
color: rgb(48, 0, 20);
margin: ...;
padding: ...;
border: ...;
}
.forContributorsBlock {
list-style: none;
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes that would be awesome to achieve. I think I still need to practice more DOM manipulations to be able to complete this one :(
homework/index.js
Outdated
| fetchJSON(url) | ||
| .then(repositoryData => { | ||
| const select = createAndAppend('select', root); | ||
| createAndAppend('option', select, { text: 'Click here to choose a Repository' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still missing:
- Data is loaded for the first repository when the app/page loads
- The repos are sorted by name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorted by name, still thinking how to start the first repo onload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorting looks good! Let me know if you need any pointers for first repo onload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you need to do is basically the following:
- Move the function that you send in as a callback to the eventhandler on line 53 to a separate function
- Call this function in the event-handler on line 53
- Call this function when the page loads
Is it clearer how to proceed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


No description provided.