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

production-card #4906

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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 @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi

❗️ Replace `<your_account>` with your Github username and copy the links to `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://gabai62.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://gabai62.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
54 changes: 53 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,64 @@
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:wght@400;500;700&display=swap"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="./styles/index.scss"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
src="./images/imac.jpeg"
alt="iMac A1419"
class="card__image"
/>

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

<p class="card__count-review">Reviews: 5</p>
</div>

<div class="card__price">
<p class="card__price-label">Price:</p>
<p class="card__price-value">$2,199</p>
</div>

<a
href="#"
class="card__button"
data-qa="hover"
>
Buy
</a>
</div>
</body>
</html>
116 changes: 116 additions & 0 deletions src/styles/blocks/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
* {
margin: 0;
padding: 0;
font-family: Roboto, sans-serif;
}

.card {
box-sizing: border-box;
width: 200px;
height: 408px;
border: 1px solid #f3f3f3;
border-radius: 5px;
padding: 32px 16px 16px;

&__image {
align-self: center;

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

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: $main-text-color;
}

&__code {
margin: 0;
padding-top: 4px;

font-weight: 400;
font-size: 10px;
line-height: 14px;
color: $secondary-text-color;
}

&__review {
display: flex;
align-items: center;
justify-content: space-between;

padding-top: 16px;
width: 166px;
height: 16px;
}

&__count-review {
display: flex;
justify-content: flex-end;
align-items: flex-end;
width: 53px;
height: 16px;
color: $main-text-color;

font-weight: 400;
font-size: 10px;
line-height: 14px;
}

&__price {
display: flex;
align-items: center;
justify-content: space-between;

width: 166px;
height: 18px;
padding-top: 24px;

&-label {
font-weight: 400;
font-size: 12px;
line-height: 18px;
color: $secondary-text-color;
}

&-value {
font-weight: 700;
font-size: 16px;
line-height: 18px;
text-align: right;
color: $main-text-color;
}
}

&__button {
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;

width: 166px;
height: 40px;
margin-top: 16px;
margin-bottom: 15px;
Comment on lines +97 to +98

Choose a reason for hiding this comment

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

There is an inconsistency in the margin values. The margin-top is set to 16px, while the margin-bottom is set to 15px. If this is intentional, it's fine, but if not, consider making them consistent.


background-color: $button-main-color;
border-radius: 5px;

color: #fff;
text-decoration: none;
text-transform: uppercase;
font-weight: 700;
font-size: 14px;
line-height: 16px;

&:hover {
color: #00acdc;
background-color: $button-hover-color;
border: 1px solid $button-main-color;
}
}
}
21 changes: 21 additions & 0 deletions src/styles/blocks/star.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.stars {
display: flex;

&__star {
background-image: url(../images/star.svg);
height: 16px;
width: 16px;
margin-right: 4px;

background-position: center;
background-repeat: no-repeat;

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

&:last-of-type {
margin: 0;
}
}
}
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 'utils/variables';
@import './blocks/card';
@import './blocks/star';
4 changes: 4 additions & 0 deletions src/styles/utils/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$main-text-color: #060b35;
$secondary-text-color: #616070;
$button-main-color: #00acdc;
$button-hover-color: #fff;
Loading