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 #5086

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

Develop #5086

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://IvanIlnytskyy.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://IvanIlnytskyy.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
52 changes: 51 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,62 @@
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"
/>
<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"
/>
<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.

The task requires SCSS variables to be defined in a separate file. Ensure that you have a separate SCSS file for variables and that it is imported correctly in your SCSS files. The Parcel bundler should handle the compilation of SCSS to CSS.

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

Choose a reason for hiding this comment

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

Suggested change
<div class="content">
<div class="product-card__content">

<h2 class="content__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h2>
<p class="content__description">Product code: 195434</p>
<div class="mark">
<div class="mark__stars">
<span class="star"></span>
<span class="star"></span>
<span class="star"></span>
<span class="star"></span>
<span class="star"></span>
</div>
Comment on lines +44 to +50

Choose a reason for hiding this comment

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

just reuse styles for stars from the stars task

<div class="mark__reviews">Reviews: 5</div>
</div>
<div class="price">
<div class="price__word">Price:</div>
<div class="price__numeric">$2,199</div>
</div>
<a
href="#"
data-qa="hover"
class="bottom"
>
Comment on lines +28 to +61

Choose a reason for hiding this comment

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

you need to follow the BEM in this task

BUY
</a>
</div>
</div>
</div>
</body>
</html>
137 changes: 137 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,140 @@
body {
margin: 0;
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 SCSS variables for properties like font-family, background-color, and other repeated values. This will help maintain consistency and make it easier to update styles globally.


@mixin bottom-color {
background-color: #00acdc;
}

@mixin text-color {
color: #060b35;
}

.product-card {
width: 200px;
box-sizing: border-box;
background-color: #fff;
border-radius: 5px;
border: 1px solid #f3f3f3;
padding: 32px 16px 16px;

&__image {
display: block;
margin: 0 auto 40px;
width: 160px;
height: 134px;
background-size: cover;
background-position: center;
}
}

.content {
background-position: center;

&__title {
display: flex;
font-size: 12px;
line-height: 18px;
font-weight: 500;
margin-bottom: 4px;

@include text-color;
}

&__description {
font-size: 10px;
line-height: 14px;
color: #616070;
margin: 0 0 16px;
}
}

.mark {
display: flex;
height: 16px;
margin-bottom: 24px;
justify-content: space-between;
align-items: center;

&__stars {
display: flex;
}

&__reviews {
font-size: 10px;
line-height: 14px;
text-align: right;
font-weight: 400;

@include text-color;
}
}

.star {
background-image: url(../images/star.svg);
background-position: 50%;
background-repeat: no-repeat;
width: 16px;
height: 16px;
border-radius: 0.5px;
gap: 4px;
margin-right: 4px;

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

.price {
display: flex;
justify-content: space-between;
margin-bottom: 16px;

&__word {
font-size: 12px;
font-weight: 400;
line-height: 18px;
text-align: left;
color: #616070;
}

&__numeric {
font-size: 16px;
font-weight: 700;
line-height: 18px;
text-align: right;

@include text-color;
}
}

.bottom {
display: block;
text-align: center;
padding: 12px;
font-size: 14px;
line-height: 16px;
color: #fff;
text-decoration: none;
border-radius: 5px;
font-weight: 700;

@include bottom-color;

&:hover {
display: block;
text-align: center;
padding: 12px;
font-size: 14px;
line-height: 16px;
text-decoration: none;
border-radius: 5px;
font-weight: 700;
position: relative;
background-color: #fff;
color: #00acdc;
box-sizing: border-box;
border: 1px solid #00acdc;
}
}
Loading