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

task solution #5029

Open
wants to merge 1 commit 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://ThyLightt.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://ThyLightt.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
46 changes: 45 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,52 @@
rel="stylesheet"
href="./styles/index.scss"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
class="card__img"
src="images/imac.jpeg"
alt="imac"
/>

<h3 class="card__title">
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</h3>

<span class="card__product-code">Product code: 195434</span>

<div class="card__reviews">
<div class="stars">
<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>

<span class="card__reviews-count">Reviews: 5</span>
</div>

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

<a
data-qa="hover"
class="card__buy-link"
href="#"
>
BUY
</a>
</div>
</body>
</html>
94 changes: 94 additions & 0 deletions src/styles/card.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
.card {
max-width: 200px;
min-height: 408px;
background-color: #fff;
border: 1px solid #f3f3f3;
border-radius: 5px;
padding: 32px 16px 16px;
display: flex;
flex-direction: column;

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

&__title {
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: #060b35;
margin-top: 40px;
margin-bottom: 4px;
}

&__product-code {
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #616070;
}

&__reviews {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 16px;
}

&__reviews-count {
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #060b35;
margin: 0;
}

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

&__price-text {
font-weight: 400;
font-size: 12px;
line-height: 18px;
color: #616070;
margin: 0;
}

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

&__buy-link {
font-weight: 700;
font-size: 14px;
width: 100%;
height: 40px;
margin: 0;
color: #fff;
background-color: #00acdc;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
text-transform: uppercase;
text-decoration: none;

&:hover {
color: #00acdc;
background-color: #fff;
border: 1px solid #00acdc;
}
}
}
7 changes: 6 additions & 1 deletion src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
body {
@import './card';
@import './stars';

* {
font-family: Roboto, sans-serif;
box-sizing: border-box;
margin: 0;
}
21 changes: 21 additions & 0 deletions src/styles/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.stars {
display: flex;
flex-direction: row;

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

&:last-child {
margin: 0;
}

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