-
-
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
My PR width DOM-api #400
My PR width DOM-api #400
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, |
I completed the self-test. I don't know what's wrong here. Perhaps I misunderstood the problem. I will be glad to receive recommendations on my mistakes in order to avoid them in the future. Thanks. |
Please, review. |
@Nik3264 Good work!🥇 |
</nav> | ||
<div class="content"> | ||
<div class="item"> | ||
|
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.
A redundant empty line. Configure your code editor to see redundant space/tabs/empty lines.
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.
Ok, I configured my code with Prettier.
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.
…space between header and img, added function render, renamed array
I removed blinking animation, reduced the space between header and image with media-query. I am not sure whether it was exactly that what I had to do. |
Good work! Let's try to put a cherry on the cake :) |
</nav> | ||
<div class="content"> | ||
<div class="item"> | ||
|
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.
submissions/Nik3264/js-dom/style.css
Outdated
} | ||
|
||
:root { | ||
--color-header: #8d7361; |
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.
Bad naming for colours. Remove color
prefix and colour must mean colour. Like space-grey, lime-green, hot-pink or just white.
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.
done
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> |
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.
Change the title name to something more appropriate for this page
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.
done
<main class="wrap"> | ||
<nav class="menu"> | ||
<div class="menu__item">Led Zeppelin</div> | ||
<div class="menu__item menu__item__active">Beatles</div> |
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.
Beatles has menu__item__active
by default but after script is inited its flushed.
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 missed this. At first I tried this in the html, and then through the function in js. And I forgot to delete it in html ))
submissions/Nik3264/js-dom/index.js
Outdated
); | ||
} | ||
|
||
hideMenuItemsActive(); |
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 will don't have any menu items with menu__item__active
on init, you will not need to call this function.
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 was a test run, already removed ))
submissions/Nik3264/js-dom/index.js
Outdated
renderContent(0, contentItem); | ||
|
||
menu.addEventListener("click", (event) => { | ||
event.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.
Write why you using preventDefault
and stopPropagation
in this event listener.
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.
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
On mobile, when tapping on the menu, a blue highlight appeared, I have not noticed before. But now I've decided to remove it. The search for this bug was longer in time. I tried everything to somehow intercept the event and process it specifically on the target, and not affect the menu. But the solution turned out to be simple. Now I know it))). But of course, I forgot to remove everything unnecessary. It's because of the rush, I'm trying to move on as quickly as possible))
submissions/Nik3264/js-dom/index.js
Outdated
|
||
const menuItem = document.querySelectorAll(".menu__item"), | ||
menu = document.querySelector(".menu"), | ||
contentItem = document.querySelector(".item"); |
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.
item
is bad naming for this class
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 have renamed on to group-info, and all following classes are group-info__header, group-info__src, etc..
Can it be like that?
submissions/Nik3264/js-dom/index.js
Outdated
paragraph = document.createElement("p"); | ||
|
||
parent.innerHTML = ""; | ||
parent.appendChild( |
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.
appendChild
support appending multiple nodes by one call
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 replaced appendChild for append, and now appending all nodes with one call. AppendChild does not allow this, at least I did not find it in the documentation. But I did know the difference between append and appendChild ))
submissions/Nik3264/js-dom/index.js
Outdated
console.log(event.target); | ||
const target = event.target; | ||
|
||
if (target && target.classList.contains("menu__item")) { |
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.
In which case you will not have event.target
?
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.
There is always a target when a click occurs. Here the condition is redundant. in my opinion. I correct it
if (target.classList.contains("menu__item"))
--color-yellow: #c9bbae; | ||
} | ||
|
||
@keyframes fade { |
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.
Drop this animation fade
and fade-text
. If you want cool animation for this block. Try to implement fade which will be fading by vertical or "fade down".
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 stuck on this animation. It would be easier to remove it immediately. And spend more time on the code)))
To be honest, I like learning js more than css.
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 forgot about this one. Change translateX(100px);
to translateY(-25px);
and opacity: 0;
to opacity: 0.75;
Don't forget about 100% step of animation there translateX
replace to 'translateY`
submissions/Nik3264/js-dom/style.css
Outdated
.group-info__text { | ||
flex-grow: 2; | ||
font-size: 1.5em; | ||
animation: fade-text 0.85s ease-out; |
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.
OK, let's correct this. Change to
fade-text 0.7s ease-out;
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.
done
submissions/Nik3264/js-dom/style.css
Outdated
text-transform: uppercase; | ||
margin-bottom: 25px; | ||
text-shadow: 2px 2px 2px var(--grey-blue); | ||
animation: fade-text 0.5s ease-out; |
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.
OK, let's correct this. Change to
fade-text 0.7s ease-out;
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.
done
submissions/Nik3264/js-dom/style.css
Outdated
margin-right: 20%; | ||
border-radius: 2%; | ||
box-shadow: 5px 15px 10px 3px; | ||
animation: fade 0.7s; |
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.
OK, let's correct this. Change to
fade 0.7s ease-out;
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.
done
submissions/Nik3264/js-dom/style.css
Outdated
0% { | ||
transform: translateY(-50px); | ||
opacity: 0; | ||
-webkit-clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 100%); |
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 clip-path
.
Change translateY(-50px);
to translateY(-25px);
Change opacity: 0;
to opacity: 0.75;
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.
done
submissions/Nik3264/js-dom/style.css
Outdated
clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 100%); | ||
} | ||
100% { | ||
transform: translateY(0); |
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 clip-path
.
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.
done
submissions/Nik3264/js-dom/style.css
Outdated
} | ||
} | ||
|
||
@media screen and (max-width: 480px) { |
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.
Mobile version should start from 768px
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.
done
@Nik3264 Looks like need one small fix to image animation and we did it! |
Thanks for your time spent for me! I feel like I still have a lot to learn. But this practice is much more than just reading documentation. I really appreciate this! |
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.
LGTM! 😸
@Nik3264 Congratulation! You really did a lot! I enjoyed your final page variant, so cool! |
Document Object Model
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.