forked from HackYourFuture/Assignments
-
Notifications
You must be signed in to change notification settings - Fork 7
Hadidreem17 w1 browsers #21
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
Open
Hadidreem17
wants to merge
2
commits into
HackYourAssignment:main
Choose a base branch
from
Hadidreem17:Hadidreem17-W1-Browsers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| ## Test Summary | ||
|
|
||
| **Mentors**: For more information on how to review homework assignments, please refer to the [Review Guide](https://github.com/HackYourFuture/mentors/blob/main/assignment-support/review-guide.md). | ||
|
|
||
| ### 2-Browsers - Week1 | ||
|
|
||
| | Exercise | Passed | Failed | ESLint | | ||
| |--------------|--------|--------|--------| | ||
| | ex1-bookList | 6 | - | ✓ | |
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 |
|---|---|---|
|
|
@@ -18,9 +18,27 @@ https://hackyourfuture.github.io/example-pages/Browsers/Week1/1-booklist/ | |
| //cspell: enable | ||
|
|
||
| function createBookList(books) { | ||
| // TODO your code goes in here, return the ul element | ||
| const ul = document.createElement ('ul'); | ||
| books.forEach( book => { | ||
| const li = document.createElement ('li'); | ||
| const p = document.createElement ( 'p'); | ||
| p.textContent = `${book.title} - ${book.author} `; | ||
| const img = document.createElement ('img'); | ||
| img.src = `https://covers.openlibrary.org/b/isbn/${book.isbn}-M.jpg`; | ||
|
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. 👍 |
||
| img.alt = `${book.title} cover`; | ||
| li.appendChild (p); | ||
| li.appendChild (img); | ||
| if (book.alreadyRead) { | ||
| li.style.backgroundColor = 'green'; | ||
| } | ||
| else | ||
| { li.style.backgroundColor = 'red'} ; | ||
| ul.appendChild (li); | ||
|
Comment on lines
+29
to
+36
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. 👍 |
||
| }); | ||
| return ul; | ||
| } | ||
|
|
||
|
|
||
| function main() { | ||
| const myBooks = [ | ||
| { | ||
|
|
||
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 |
|---|---|---|
| @@ -1 +1,37 @@ | ||
| /* Write your style here */ | ||
| body { | ||
| font-family: Arial, sans-serif; | ||
| background-color: #f4f4f4; | ||
| margin: 0; | ||
| padding: 20px; | ||
| } | ||
| h1 { | ||
| text-align: center; | ||
| color: #333; | ||
| } | ||
| ul { | ||
| list-style-type: none; | ||
| padding: 0; | ||
| display : grid ; | ||
| grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); | ||
| gap : 16px; | ||
|
|
||
| } | ||
| li { | ||
| background: #fff; | ||
| margin: 10px 0; | ||
| padding: 15px; | ||
| border-radius: 5px; | ||
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); | ||
| } | ||
| img { | ||
| width: 100% ; | ||
| height: auto ; | ||
| border -radius: 5px ; | ||
| display : block ; | ||
|
|
||
| } | ||
| p { | ||
| margin: 0; | ||
| padding: 0; | ||
| } | ||
|
Comment on lines
+2
to
+37
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. 👍 |
||
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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| *** Unit Test Error Report *** | ||
|
|
||
| PASS .dist/2-Browsers/Week1/unit-tests/ex1-bookList.test.js | ||
| br-wk1-ex1-bookList | ||
| ✅ HTML should be syntactically valid (136 ms) | ||
| ✅ should have all TODO comments removed | ||
| ✅ should contain a <ul> that is a child of <div id="bookList"> (2 ms) | ||
| ✅ should contain a <ul> with 3 <li> elements (1 ms) | ||
| ✅ should contain an <li> with title and author for each book of the `myBooks` array (1 ms) | ||
| ✅ should contain an <img> element for each book | ||
|
|
||
| Test Suites: 1 passed, 1 total | ||
| Tests: 6 passed, 6 total | ||
| Snapshots: 0 total | ||
| Time: 3.628 s, estimated 13 s | ||
| Ran all test suites matching /C:\\Users\\Rimha\\Assignments-Cohort54\\.dist\\2-Browsers\\Week1\\unit-tests\\ex1-bookList.test.js/i. | ||
| No linting errors detected. | ||
| No spelling errors detected. |
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.
👍