-
-
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
dom-api-task #426
dom-api-task #426
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, |
Hey! |
@vl-shevchenko Nice work! 💯 |
@@ -0,0 +1,83 @@ | |||
const city = [ | |||
{ | |||
color: 'url(images/kyiv5-904w.jpg)', |
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.
Colour is a link to image? Should have another name. And remove url
.
}, | ||
]; | ||
|
||
let defaultContent = document.querySelector('.container'); |
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.
If you do not change a variable(with =
operator) always use const.
]; | ||
|
||
let defaultContent = document.querySelector('.container'); | ||
defaultContent.innerHTML = `<p class='info'>${city[0].info}</p>`; |
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.
Should be in function for setting default content.
defaultName.innerText = `${city[0].name}`; | ||
|
||
const buildMenu = city => { | ||
document.querySelector('.nav__bloc').innerHTML = `<ul class='container-list'></ul>`; |
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.
.nav__block
functional and city
should be in different functions.
nameCity.classList.add('menu-list'); | ||
nameCity.innerHTML = `<a href="#" class='menu-link'>${val.name}</a>`; | ||
|
||
document.querySelector('.container-list').appendChild(nameCity); |
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.
You already have var for .container-list
on line 53. Why you reselect it?
html { | ||
box-sizing: border-box; | ||
font-size: 16px; | ||
|
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.
Remove redundant empty lines.
|
||
let currentCity = e.target.innerHTML; | ||
let info = ''; | ||
let color = ''; |
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 is not a color.
} | ||
} | ||
|
||
document.body.style.backgroundImage = color; |
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.
Remove temp let
vars, move this logic to if
at line 62 and move if
body to function.
const popup = document.querySelector('#popup'); | ||
burger.addEventListener('click', burgerhandler); | ||
function burgerhandler(e) { | ||
e.preventDefault(); |
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.
Why do we need here preventDefault
?
width: 250px; | ||
min-height: 300px; | ||
height: 80%; | ||
background: rgba(255, 237, 224, 0.56); |
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.
Move colors to css3 vars.
UI/UX Improvements: |
This issue has been automatically marked as stale because there were no activity during last 14 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. А. Чому так? Б. Що робити, якщо в піарі нема оновлень, оскільки не зрозуміло, що треба зробити? В. А якщо я все зробив(ла) і це ментор не рев'юває мої зміни?
Г. Хіба недостатньо того, що я додав(ла) коміт із змінами? Традиційна пропозиція: задай питання по вищенаписаному в студентському чаті. |
###dom-api-task
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.