-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
js-dom #295
js-dom #295
Conversation
Hey! Congratulations on your PR! 😎😎😎 Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code. Go through the requirements/most common mistakes listed/linked below and fix the code as appropriate. If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat. When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly. Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒 Please, make sure you haven't made common mistakes Universal recommendations:
Also take a note of the requirements above and follow them in all your future projects. By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
It seems to me that I checked everything according to the instructions. Please rewiew. |
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.
Nice work! See some comments below.
submissions/Yasya23/js-dom/script.js
Outdated
|
||
const images = [ | ||
{ | ||
id: "cat", |
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.
ID is a unique number.
Change the property name to category.
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.
Thanks for checking! Fixed it.
submissions/Yasya23/js-dom/script.js
Outdated
} | ||
|
||
function showPopup() { | ||
const menu = document.querySelector("#navigation"); |
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 think you can realize it in CSS. Add use the methods Element.classList.add/remove/toggle
.
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 it.
submissions/Yasya23/js-dom/script.js
Outdated
cat.addEventListener("click", changeImagesByClick); | ||
dog.addEventListener("click", changeImagesByClick); | ||
horse.addEventListener("click", changeImagesByClick); |
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.
Add a listener for the parent element.
const menuList = document.querySelector('.navigation');
menuList.addEventListener('click', changeImagesByClick)
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 it.
submissions/Yasya23/js-dom/script.js
Outdated
@@ -0,0 +1,208 @@ | |||
"use strict"; | |||
|
|||
const images = [ |
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.
Rename to 'animalList'. The naming of variables must be more informative.
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 it.
submissions/Yasya23/js-dom/script.js
Outdated
document.querySelector("main").innerHTML = ` | ||
<div class="img"> | ||
<div class="img__column"> | ||
<img | ||
src="${images[0].src}" alt="${images[0].alt}" | ||
/> | ||
<img | ||
src="${images[10].src}" alt="${images[10].alt}" |
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.
Create render function.
Add initial value to first render to list.
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 not sure I did it right.
Thanks for the help! |
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.
Great, I approve of your work. Good luck with future tasks!
js-dom
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.