-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
add solution #4869
base: master
Are you sure you want to change the base?
add solution #4869
Conversation
Knysh19
commented
Nov 24, 2024
- DEMO LINK
- TEST REPORT LINK
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.
Thank you for your hard work on this project! 😊 While your code meets many of the task requirements, there are a few critical issues that need to be addressed before we can approve the pull request. The scale transformation on hover is too large, which might affect the layout or cause overlap with other elements. Additionally, ensure that all CSS values include appropriate units, such as 'px', to maintain cross-browser compatibility. Lastly, consider using a templating approach or JavaScript to dynamically generate repeated product card elements to reduce redundancy and improve maintainability. Once these issues are resolved, your solution will be in great shape! Keep up the great work! 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
> | ||
BUY | ||
</a> | ||
</div> | ||
|
||
<div class="card"> | ||
<img | ||
class="card__image" | ||
src="./images/imac.jpeg" | ||
alt="iMac" | ||
/> | ||
<h2 class="card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h2> | ||
<p class="card__code">Product code: 195434</p> | ||
<div class="card__review"> | ||
<div class="stars"> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star"></div> | ||
</div> | ||
<p class="card__review_count">Reviews: 5</p> | ||
</div> | ||
<div class="card__price"> | ||
<p class="card__price_text">Price:</p> | ||
<p class="card__price_count">$2,199</p> | ||
</div> | ||
<a | ||
href="#" | ||
class="card__button" | ||
> | ||
BUY | ||
</a> | ||
</div> | ||
|
||
<div class="card"> | ||
<img | ||
class="card__image" | ||
src="./images/imac.jpeg" | ||
alt="iMac" | ||
/> | ||
<h2 class="card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h2> | ||
<p class="card__code">Product code: 195434</p> | ||
<div class="card__review"> | ||
<div class="stars"> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star"></div> | ||
</div> | ||
<p class="card__review_count">Reviews: 5</p> | ||
</div> | ||
<div class="card__price"> | ||
<p class="card__price_text">Price:</p> | ||
<p class="card__price_count">$2,199</p> | ||
</div> | ||
<a | ||
href="#" | ||
class="card__button" | ||
> | ||
BUY | ||
</a> | ||
</div> | ||
|
||
<div class="card"> | ||
<img | ||
class="card__image" | ||
src="./images/imac.jpeg" | ||
alt="iMac" | ||
/> | ||
<h2 class="card__title"> | ||
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) | ||
</h2> | ||
<p class="card__code">Product code: 195434</p> | ||
<div class="card__review"> | ||
<div class="stars"> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star"></div> | ||
</div> | ||
<p class="card__review_count">Reviews: 5</p> | ||
</div> | ||
<div class="card__price"> | ||
<p class="card__price_text">Price:</p> | ||
<p class="card__price_count">$2,199</p> | ||
</div> | ||
<a | ||
href="#" | ||
class="card__button" | ||
> | ||
BUY | ||
</a> | ||
</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.
The product card elements are repeated multiple times with identical content. Consider using a templating engine or JavaScript to dynamically generate these cards to avoid redundancy and improve maintainability.
src/styles/index.scss
Outdated
.is-active::after { | ||
content: ''; | ||
position: absolute; | ||
bottom: -19; |
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.
The value for 'bottom' should include a unit (e.g., 'px'). Without a unit, this might not work as expected in some browsers.
src/styles/index.scss
Outdated
.card:hover { | ||
transform: scale(1.2); |
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.
The scale transformation on hover might be too large (1.2), which could affect the layout or cause overlap with other elements. Consider using a smaller scale value to ensure a smoother user experience.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: 4]
Additional info:
Ignored files list:
src/index.html
src/styles/index.scss
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: 4]
Additional info:
Ignored files list:
src/index.html
src/styles/index.scss
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: 4]
Additional info:
Ignored files list:
src/index.html
src/styles/index.scss
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
Sorry, the pull request review was unsuccessful for the following reasons:
Warning
There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: 4]
Additional info:
Ignored files list:
src/index.html
src/styles/index.scss
If the issue is within your control, please address it.
The next review attempt will automatically launch in 1 hour.
If you believe this is an error or need assistance, please contact the support team.
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.
GJ 👍 Added a few comments
src/styles/index.scss
Outdated
|
||
.card__code { | ||
font-size: 10px; | ||
font-weight: 400; |
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.
400 is a default font-weight value - no need to set it everywhere
src/styles/index.scss
Outdated
margin: 0; | ||
} | ||
|
||
.card { |
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 each BEM block to a separate file
Also, use SCSS nesting
src/styles/index.scss
Outdated
--blue-color: #00acdc; | ||
--black-color: #060b35; |
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've already defined such colors in SCSS variables above
.header { | ||
display: flex; | ||
justify-content: end; | ||
gap: 243px; |
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.
redundant
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.
What exactly can be simplified here?
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.
src/styles/index.scss
Outdated
margin: 0; | ||
} | ||
|
||
.nav__link-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.
.nav__link-list { | |
.nav__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.
Good job!
Let's improve your code
src/index.html
Outdated
<li class="nav__item"> | ||
<a | ||
class="nav__link is-active" | ||
href="#" | ||
> | ||
Apple | ||
</a> | ||
</li> | ||
<li class="nav__link">Samsung</li> |
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.
Every word should be a link, fix it everywhere
<li class="nav__item"> | |
<a | |
class="nav__link is-active" | |
href="#" | |
> | |
Apple | |
</a> | |
</li> | |
<li class="nav__link">Samsung</li> | |
<li class="nav__item"> | |
<a | |
class="nav__link is-active" | |
href="#apple" | |
> | |
Apple | |
</a> | |
</li> | |
<li class="nav__item"> | |
<a class="nav__link" href="#samsung">Samsung</a> | |
</li> |
src/styles/index.scss
Outdated
$primary-color: #00acdc; | ||
$font-color: #060b35; | ||
$light-grey: #616070; | ||
$font-family: 'Roboto', sans-serif; |
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 variables to the separate file
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.
How to do it?
src/styles/index.scss
Outdated
margin: 0; | ||
min-width: 1024px; |
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.
margin: 0; | |
min-width: 1024px; |
src/styles/index.scss
Outdated
justify-content: end; | ||
gap: 243px; | ||
height: 60px; | ||
background-color: #fff; |
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.
This color is default
background-color: #fff; |
src/styles/index.scss
Outdated
.nav__list { | ||
display: flex; | ||
gap: 20px; | ||
list-style-type: none; | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
.nav__link { | ||
color: #060b35; | ||
cursor: pointer; | ||
text-transform: uppercase; | ||
transition: color 0.3s; | ||
position: relative; | ||
line-height: 60px; | ||
display: block; | ||
height: 60px; | ||
} | ||
|
||
.nav { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.nav__link:hover { | ||
color: $primary-color; | ||
} | ||
|
||
.is-active { |
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 header styles to the separate file
src/styles/index.scss
Outdated
.container { | ||
display: grid; | ||
grid-template-columns: repeat(1, 200px); | ||
gap: 46px 48px; | ||
justify-content: center; | ||
padding: 50px 40px; | ||
|
||
@media (min-width: 488px) { | ||
grid-template-columns: repeat(2, 200px); | ||
} | ||
|
||
@media (min-width: 768px) { | ||
grid-template-columns: repeat(3, 200px); | ||
} | ||
|
||
@media (min-width: 1024px) { | ||
grid-template-columns: repeat(4, 200px); | ||
} | ||
} |
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 container styles to the separate file
src/styles/index.scss
Outdated
border-radius: 5px; | ||
width: 200px; | ||
margin: 0; | ||
padding: 32px 16px 16px; | ||
font-family: $font-family; | ||
border: 1px solid #f3f3f3; | ||
transition: | ||
transform 0.3s ease, | ||
color 0.3s ease; | ||
} | ||
|
||
.card__image { | ||
width: 160px; | ||
height: 134px; | ||
margin: 0 auto 40px; | ||
display: block; | ||
} | ||
|
||
.card__title { | ||
font-size: 12px; | ||
font-weight: 500; | ||
line-height: 18px; | ||
color: $font-color; | ||
margin-bottom: 4px; | ||
transition: color 0.3s ease; | ||
} |
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 these styles to the separate card file styles styles, and use scss nesting everywhere
src/styles/index.scss
Outdated
.stars { | ||
display: flex; | ||
gap: 4px; | ||
padding-left: 1px; | ||
align-items: center; | ||
} | ||
|
||
.stars__star { | ||
background-image: url(../images/star.svg); | ||
width: 16px; | ||
height: 16px; | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
} | ||
|
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 stars styles to the separate file
<div class="stars"> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star"></div> | ||
</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.
Fix it everywhere
<div class="stars"> | |
<div class="stars__star-active"></div> | |
<div class="stars__star-active"></div> | |
<div class="stars__star-active"></div> | |
<div class="stars__star-active"></div> | |
<div class="stars__star"></div> | |
</div> | |
<div class="stars stars--4"> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
<div class="stars__star"></div> | |
</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.
.header { | ||
display: flex; | ||
justify-content: end; | ||
gap: 243px; |
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.
<div class="stars"> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star-active"></div> | ||
<div class="stars__star"></div> | ||
</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.