Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
solyaqw committed Oct 11, 2024
1 parent a19f710 commit 837ef16
Show file tree
Hide file tree
Showing 3 changed files with 183 additions and 3 deletions.
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://solyaqw.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://solyaqw.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
57 changes: 56 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,68 @@
name="viewport"
content="width=device-width, initial-scale=1.0"
/>

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

<title>Product cards</title>
<link
rel="stylesheet"
href="./styles/index.scss"
/>
</head>
<body>
<h1>Product cards</h1>
<div
class="card"
data-qa="card"
>
<img
src="../src/images/imac.jpeg"
alt="imac"
class="card__product-image"
/>

<h3 class="card__product-name">
APPLE A1419 iMac 27" Retina
<br />
5K Monoblock (MNED2UA/A)
</h3>

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

<div class="card__product-rating">
<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>
<h4 class="card__product-rating-review">Reviews: 5</h4>
</div>

<div class="card__product-price">
<h3 class="card__product-price-text">Price:</h3>
<h1 class="card__product-price-numbers">$2,199</h1>
</div>

<a
href="#"
class="card__product-buy-link"
data-qa="hover"
>
BUY
</a>
</div>
</body>
</html>
125 changes: 125 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
body {
margin: 0;
}

// #region card

.card {
font-family: Roboto, sans-serif;
box-sizing: border-box;
width: 200px;
padding: 16px;

&__product-image {
padding: 16px 3px 0;
display: flex;
top: 33px;
left: 20px;
width: 160px;
height: 134px;
}

&__product-name {
margin: 0;
padding-top: 40px;
font-weight: 500;
font-size: 12px;
line-height: 18px;
color: #060b35;
}

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

&__product-rating {
padding-top: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
width: 166px;
height: 16px;

&-review {
margin: 0;
display: flex;
font-weight: 400;
font-size: 10px;
line-height: 14px;
color: #060b35;
align-self: flex-end;
}
}

&__product-price {
padding-top: 24px;
padding-bottom: 16px;
display: flex;
flex-direction: row;
justify-content: space-between;
line-height: 18px;

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

&-numbers {
margin: 0;
font-weight: 700;
font-size: 16px;
}
}

&__product-buy-link {
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
width: 166px;
height: 40px;
background-color: #00acdc;

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

&:hover {
background-color: #fff;
color: #00acdc;
border-style: solid;
border-width: 1px;
border-color: #00acdc;
}
}
}

// #endregion

// #region stars

.stars {
display: flex;

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

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

// #endregion

0 comments on commit 837ef16

Please sign in to comment.