Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliia2211 committed Oct 16, 2024
1 parent a19f710 commit 6da5857
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 6 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://nataliia2211.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://nataliia2211.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/Button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 65 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,81 @@
<!doctype html>
<html lang="en">
<!-- # region head -->
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>Product cards</title>
<title>Product 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"
/>
</head>
<!-- # end region -->

<body>
<h1>Product cards</h1>
<div
class="product-card"
data-qa="card"
>
<img
src="images/imac.jpeg"
alt="Computer"
class="product-card__image"
/>
<h1 class="product-card__items product-card__items--title">
APPLE A1419 iMac 27" Retina
<br />
5K Monoblock (MNED2UA/A)
</h1>

<h2 class="product-card__items product-card__items--product-code">
Product code: 195434
</h2>

<div class="product-card__items product-card__items--position">
<div class="product-card__items-stars">
<div class="product-card__items-stars-star"></div>

<div class="product-card__items-stars-star"></div>

<div class="product-card__items-stars-star"></div>

<div class="product-card__items-stars-star"></div>

<div
class="product-card__items-stars-star product-card__items-stars-star--not-active"
></div>
</div>
<h2 class="product-card__items-reviews">Reviews: 5</h2>
</div>

<div class="product-card__items product-card__items--position">
<h2 class="product-card__price product-card__price--letters">Price:</h2>
<h2 class="product-card__price product-card__price--numbers">$2,199</h2>
</div>
<a
href="#"
class="product-card__items product-card__items--link"
data-qa="hover"
>
Buy
</a>
</div>
</body>
</html>
90 changes: 90 additions & 0 deletions src/styles/body.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
.product-card {
width: 200px;
display: flex;
flex-direction: column;
align-items: center;
border: 1px solid #f3f3f3;
padding: 32px 16px 16px;
}

.product-card__items {
display: flex;
width: 100%;
padding: 0;
margin: 0;
}

.product-card__image {
width: 160px;
height: 134px;
}

.product-card__items--title {
font-size: 12px;
font-weight: 500;
line-height: 18px;
text-align: center;
margin-top: 40px;
}

.product-card__items--product-code {
display: flex;
justify-content: flex-start;
font-size: 10px;
font-weight: 400;
line-height: 14px;
margin-top: 4px;
}

.product-card__items--position {
display: flex;
justify-content: space-between;
align-items: center;
}

.product-card__items-reviews {
font-size: 10px;
font-weight: 400;
line-height: 14px;
}

.product-card__price {
display: flex;
margin-top: 24px;
}

.product-card__price--letters {
font-size: 12px;
font-weight: 400;
line-height: 18px;
}

.product-card__price--numbers {
font-size: 16px;
font-weight: 700;
line-height: 18px;
}

.product-card__items--link {
display: flex;
justify-content: center;
align-items: center;
background-color: #00acdc;
width: 166px;
height: 40px;
border-radius: 5px;
font-size: 14px;
font-weight: 700;
line-height: 40px;
text-align: center;
text-transform: uppercase;
text-decoration: none;
color: #f3f3f3;
}

.product-card__items--link:hover {
background-color: #f3f3f3;
color: #00acdc;
border: 1px solid #00acdc;
border-radius: 5px;
}
11 changes: 9 additions & 2 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
body {
margin: 0;
@import 'body';
@import 'stars';

* {
box-sizing: border-box;
}

html {
font-family: Roboto, sans-serif;
}
17 changes: 17 additions & 0 deletions src/styles/stars.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.product-card__items-stars {
display: flex;
margin-top: 24px;
}

.product-card__items-stars-star {
display: flex;
background-image: url(../images/star-active.svg);
background-repeat: no-repeat;
background-position: center;
width: 16px;
height: 16px;
}

.product-card__items-stars-star--not-active {
background-image: url(../images/star.svg);
}

0 comments on commit 6da5857

Please sign in to comment.