Skip to content

Commit

Permalink
Card
Browse files Browse the repository at this point in the history
  • Loading branch information
SemenVodolazskij committed Oct 16, 2024
1 parent a19f710 commit 2b80659
Show file tree
Hide file tree
Showing 3 changed files with 140 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://SemenVodolazskij.github.io/layout_product-cards/)
- [TEST REPORT LINK](https://SemenVodolazskij.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
47 changes: 46 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,57 @@
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"
class="card_image card_image--imac"
/>
<div class="description">
Apple A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
</div>
<div class="product_code">Product code: 195434</div>
<div class="star_review">
<div class="stars_active"></div>
<div class="stars_active"></div>
<div class="stars_active"></div>
<div class="stars_active"></div>
<div class="stars"></div>

<span class="reviews">Reviews: 5</span>
</div>
<div class="price">
<span class="text_price">Price:</span>
<span class="numeric_price">$2,199</span>
</div>
<button
class="button_buy"
data-qa="hover"
>
<span class="button_text">Buy</span>
</button>
</div>
</body>
</html>
92 changes: 92 additions & 0 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,95 @@
body {
margin: 0;
font-family: Roboto, sans-serif, Arial;
}

.card {
width: 200px;
padding: 32px 16px 16px;
}

.card_image {
display: flex;
width: 160px;
height: 134px;
margin-bottom: 40px;
}

.description {
font-weight: 500;
margin-bottom: 4px;
font-size: 12px;
}

.card_image--imac {
background-image: url(../images/imac.jpeg);
}

.product_code {
margin-bottom: 16px;
font-size: 10px;
line-height: 14px;
}

.star_review {
margin-bottom: 24px;
display: flex;
justify-content: space-between;
}

.reviews {
display: flex;
white-space: nowrap;
font-size: 10px;
align-items: center;
}

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

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

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

.text_price {
color: #616070;
}

.numeric_price {
font-family: Roboto, sans-serif, Arial;
font-weight: 700;
}

.button_buy {
display: flex;
justify-content: center;
align-items: center;
background-color: #00acdc;
color: white;
border-radius: 5px;
width: 100%;
height: 40px;
border: solid #00acdc;
}

.button_buy:hover {
background-color: white;
color: #00acdc;
}

0 comments on commit 2b80659

Please sign in to comment.