generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 221
London|25-ITP-September|Alexandru Pocovnicu|Sprint 3|Reading list #852
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
Closed
alexandru-pocovnicu
wants to merge
14
commits into
CodeYourFuture:main
from
alexandru-pocovnicu:reading-list
Closed
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
71fa218
Add initial test file for mean calculations
alexandru-pocovnicu 927769b
Add mean.js file for mean calculations
alexandru-pocovnicu a393af9
Remove mean.js and mean.test.js files
alexandru-pocovnicu c26934b
Update title in index.html to reflect the app name
alexandru-pocovnicu 43d53c5
Implement renderBooks function to display reading list with styling b…
alexandru-pocovnicu 744f0a7
Add styles for reading list items and images
alexandru-pocovnicu 03d9f08
Fix formatting of reading list in index.html for better readability
alexandru-pocovnicu 7c2dfb3
Rename renderBooks function to readingList for consistency and clarity
alexandru-pocovnicu 3cac639
added classes instead of in-line style
alexandru-pocovnicu 74ccd13
added backgroud colors to the elements
alexandru-pocovnicu 0ecd3e0
refactored function to use object destructuring in order to get field…
alexandru-pocovnicu 8dc9906
changed test to check for class instead of baxckground color
alexandru-pocovnicu ff160fc
changed code to append two nodes in one line
alexandru-pocovnicu 24465d2
added style to the images
alexandru-pocovnicu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,23 @@ const books = [ | |
| }, | ||
| ]; | ||
|
|
||
| function readingList() { | ||
| const unorderedList = document.querySelector("#reading-list"); | ||
| for (const book of books) { | ||
| const newList = document.createElement("li"); | ||
| const newImage = document.createElement("img"); | ||
| const { title, author, bookCoverImage } = book; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could do something more interesting. Just fyi |
||
| newImage.src = bookCoverImage; | ||
| const paragraph = document.createElement("p"); | ||
| paragraph.textContent = `${title} by ${author}`; | ||
| newList.append(paragraph, newImage); | ||
| if (book.alreadyRead) { | ||
| newList.classList.add("read"); | ||
| } else { | ||
| newList.classList.add("notRead"); | ||
| } | ||
|
|
||
| unorderedList.appendChild(newList); | ||
| } | ||
| } | ||
| readingList(); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Is this a good name for the variable? Another thing, what if you code cannot find this dom element? How can you guard your function against it?