From 837ef161569383893cc9481e89a9e7c1e8a02317 Mon Sep 17 00:00:00 2001 From: Solomiia Palka Date: Fri, 11 Oct 2024 15:05:01 +0300 Subject: [PATCH] add task solution --- readme.md | 4 +- src/index.html | 57 ++++++++++++++++++- src/styles/index.scss | 125 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 183 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 3354ca6020..4148072d8f 100644 --- a/readme.md +++ b/readme.md @@ -20,8 +20,8 @@ Create a pages with product card using `flexbox`, `BEM` and `SCSS` based on [thi ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_product-cards/) -- [TEST REPORT LINK](https://.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. diff --git a/src/index.html b/src/index.html index 43745cc17f..b0bec89d5a 100644 --- a/src/index.html +++ b/src/index.html @@ -6,6 +6,20 @@ name="viewport" content="width=device-width, initial-scale=1.0" /> + + + + + Product cards -

Product cards

+
+ imac + +

+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + BUY + +
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..3f054b0500 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -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