Skip to content
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 asolution #5256

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_product-cards/report/html_report/)
- [DEMO LINK](https://koguts.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://koguts.github.io/layout_product-cards/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand Down
50 changes: 49 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
rel="stylesheet"
/>
<meta charset="UTF-8" />
<meta
name="viewport"
Expand All @@ -13,6 +25,42 @@
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__image"
src="./images/imac.jpeg"
alt="Product"
/>
<section class="card__info">
<div class="card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<span class="card__code">Product code: 195434</span>
<div class="card__reviews">
<div class="stars stars--rating-4">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify that all stars--N modifiers are implemented as required by the task. This was a critical issue noted in the previous review.

<div class="stars__star stars__star--active"></div>
<div class="stars__star stars__star--active"></div>
<div class="stars__star stars__star--active"></div>
<div class="stars__star stars__star--active"></div>
<div class="stars__star"></div>
</div>
<div class="card__reviews-value">Reviews: 5</div>
</div>
<div class="card__price">
<span class="card__price-title">Price:</span>
<span class="card__price-value">$2,199</span>
</div>
<a
href="#"
data-qa="hover"
class="card__button"
>
BUY
</a>
</section>
</div>
</body>
</html>
89 changes: 89 additions & 0 deletions src/styles/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.card {
width: 200px;
height: 400px;
display: flex;
box-sizing: border-box;
flex-direction: column;
align-items: center;
padding: 32px 16px 16px;
border: 1px solid #f3f3f3;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using SCSS variables for colors like #f3f3f3 to improve maintainability and readability. This aligns with the task requirement to use SCSS variables.

border-radius: 5px;

&__image {
height: 134px;
width: 160px;
margin-bottom: 40px;
}

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
margin: 0;
}

&__code {
color: #616070;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using SCSS variables for colors like #616070 to improve maintainability and readability. This aligns with the task requirement to use SCSS variables.

font-weight: 400;
font-size: 10px;
line-height: 14px;
margin-bottom: 16px;
margin-top: 4px;
}

&__reviews {
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
margin: 15px 0 24px;
}

&__reviews-value {
font-weight: 400;
font-size: 10px;
line-height: 14px;
}

&__price {
display: flex;
justify-content: space-between;
}

&__price-title {
color: #616070;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using SCSS variables for colors like #616070 to improve maintainability and readability. This aligns with the task requirement to use SCSS variables.

font-weight: 400;
font-size: 12px;
line-height: 18px;
}

&__price-value {
font-weight: 700;
font-size: 16px;
line-height: 18px;
margin-bottom: 16px;
}

&__button {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
height: 40px;
border-radius: 5px;
border: 1 solid #00acdc;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The border property is missing the unit for the border width. It should be 1px solid #00acdc.

font-size: 14;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font-size property is missing the unit. It should be 14px.

line-height: 16;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line-height property is missing the unit. It should be 16px.

font-weight: 700;
text-transform: uppercase;
text-decoration: none;
background-color: #00acdc;
color: white;
margin-bottom: 16px;
}

&__button:hover {
background-color: #fff;
color: #00acdc;
}
}
6 changes: 6 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@import '/src/styles/card';
@import '/src/styles/stars';
@import '/src/styles/mixins';
Comment on lines +1 to +3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the imported SCSS files, such as card.scss, utilize SCSS variables as required by the task. This was a critical issue noted in the previous review.


body {
margin: 0;
padding: 20px;
font-family: Roboto, Arial, serif;
}
9 changes: 9 additions & 0 deletions src/styles/mixins.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@mixin roboto-font {
font-family: Roboto, serif;
}

@mixin display-position {
display: flex;
justify-content: space-between;
align-items: center;
}
16 changes: 16 additions & 0 deletions src/styles/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.stars {
display: flex;

&__star {
height: 16px;
width: 16px;
background-image: url('../images/star.svg');
background-repeat: no-repeat;
background-position: center;
margin-right: 4px;
}
}

.stars--rating-4 .stars__star:nth-child(-n + 4) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that all stars--N modifiers are implemented as required by the task to handle different rating levels, not just stars--rating-4.

background-image: url('../images/star-active.svg');
}
Loading