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

Develop #5124

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Develop #5124

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://Anna-0805.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://Anna-0805.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
Binary file added src/images/imac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 48 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,59 @@
content="width=device-width, initial-scale=1.0"
/>
<title>Product cards</title>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"

Choose a reason for hiding this comment

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

Ensure that the SCSS file index.scss includes the separated BEM blocks for card and stars as required by the task. They should be in separate SCSS files.

/>
</head>
<body>
<h1>Product cards</h1>
<div
class="product-card"
data-qa="card"
>
<img
class="product-card__image"
src="./images/imac.jpeg"

Choose a reason for hiding this comment

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

The image path should be relative to the index.scss file, starting with ../images. Please adjust the path accordingly to ensure it is correct.

alt="apple"
/>
<h2 class="product-card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>
<div class="product-card__code">Product code: 195434</div>
<div class="product-card__mark">
<div class="stars">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="reviews">Reviews: 5</div>
</div>
<div class="product-card__price">
<span class="product-card__price-label">Price:</span>
<span class="product-card__price-value">$2,199</span>
</div>
<a
href="#"
class="product-card__button"
data-qa="hover"
>
BUY
</a>
</div>
</body>
</html>
91 changes: 91 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
.product-card {
width: 200px;

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 main values such as colors, font sizes, and dimensions. This will make your code more maintainable and easier to update.


border: 1px solid #f3f3f3;
border-radius: 5px;
background-color: #fff;

Choose a reason for hiding this comment

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

The background color should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements.


display: flex;
flex-direction: column;
padding: 32px 16px 16px;

&__image {
width: 160px;
height: 134px;
display: block;
margin: 0 auto 40px;
}

&__title {
margin: 0;
padding: 0;
font-size: 12px;
line-height: 18px;
font-weight: 500;
color: #060b35;

Choose a reason for hiding this comment

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

The color value should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements.


width: 100%;
}
&__code {
font-size: 10px;
color: #616070;
text-align: left;
margin-top: 4px;
line-height: 14px;
}

&__price {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
margin-top: 24px;
}

&__price-label {
font-size: 12px;
color: #616070;
}

&__price-value {
font-size: 16px;
line-height: 18px;
font-weight: 700;
color: #060b35;

Choose a reason for hiding this comment

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

The color value should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements.

text-align: right;
}

&__button {
text-decoration: none;
width: 100%;
height: 40px;
margin-top: 16px;
display: flex;
justify-content: center;
align-items: center;
background-color: #00acdc;

Choose a reason for hiding this comment

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

The background color should be defined using a SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements.

color: #fff;
font-weight: 700;
border-radius: 5px;
border: 1px solid;
border-color: #00acdc;
font-size: 14px;
line-height: 16px;
}

&__button:hover {
background-color: #fff;
color: #00acdc;
border-radius: 5px;
border: 1px solid;
border-color: #00acdc;
}

&__mark {
display: flex;
align-items: center;
justify-content: space-between;
height: 16px;
margin-top: 16px;
}
}
9 changes: 9 additions & 0 deletions src/styles/blocks/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
font-family: Roboto, sans-serif;

Choose a reason for hiding this comment

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

Consider using an SCSS variable for the font family. This will make it easier to update the font across the entire project if needed.

}
24 changes: 24 additions & 0 deletions src/styles/blocks/star.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.stars {
display: flex;
&__star {
width: 16px;

Choose a reason for hiding this comment

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

Consider using an SCSS variable for the width and height values. This will make it easier to update these values across the project if needed.

height: 16px;
background-image: url(../images/star.svg);
background-position: center;
background-repeat: no-repeat;
margin-right: 4px;
border-radius: 0.5px;
}

&__star:nth-child(-n + 4) {
background-image: url(../images/star-active.svg);
}
}

.reviews {
font-size: 10px;
font-weight: 400;
line-height: 14px;
text-align: right;
color: #060b35;

Choose a reason for hiding this comment

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

The color value should be defined using an SCSS variable. Ensure that all main values are stored in a separate variables file as per the task requirements.

}
6 changes: 3 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
body {
margin: 0;
}
@import 'blocks/main';
@import 'blocks/card';
@import 'blocks/star';
Loading