From 6aef8e9a33dc2b84b09616a6f6e42c1c47357086 Mon Sep 17 00:00:00 2001 From: Kyrylo Bondarenko Date: Fri, 27 Dec 2024 23:04:12 +0200 Subject: [PATCH] add solution --- readme.md | 4 +-- src/index.html | 68 ++++++++++++++++++++++++++++++++++++-- src/styles/button.scss | 22 +++++++++++++ src/styles/card.scss | 75 ++++++++++++++++++++++++++++++++++++++++++ src/styles/index.scss | 7 ++-- src/styles/page.scss | 6 ++++ src/styles/rating.scss | 22 +++++++++++++ 7 files changed, 197 insertions(+), 7 deletions(-) create mode 100644 src/styles/button.scss create mode 100644 src/styles/card.scss create mode 100644 src/styles/page.scss create mode 100644 src/styles/rating.scss diff --git a/readme.md b/readme.md index b1f43ed970..25da973b97 100644 --- a/readme.md +++ b/readme.md @@ -23,8 +23,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ❗️ Replace `` with your GitHub username and copy the links to the `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://DeJisk.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://DeJisk.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..135c93e1a3 100644 --- a/src/index.html +++ b/src/index.html @@ -7,12 +7,76 @@ 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
+
+ + +
diff --git a/src/styles/button.scss b/src/styles/button.scss new file mode 100644 index 0000000000..bb1e1cca71 --- /dev/null +++ b/src/styles/button.scss @@ -0,0 +1,22 @@ +.button { + box-sizing: border-box; + display: block; + padding: 12px 69.5px; + color: #fff; + font-size: 14px; + font-weight: 700; + text-align: center; + outline: none; + border-radius: 5px; + background-color: #00acdc; + cursor: pointer; + text-transform: uppercase; + max-width: 166px; + border: 1px solid #00acdc; + height: 40px; + + &--hover:hover { + background-color: #fff; + color: #00acdc; + } +} diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..24ad430494 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,75 @@ +.card { + display: flex; + flex-direction: column; + padding-inline: 16px; + padding-block: 32px 16px; + width: 200px; + border-radius: 5px; + border: 1px solid #f3f3f3; + box-sizing: border-box; + + &__container { + max-width: 160px; + flex: 0 1 134px; + margin-inline: auto; + margin-bottom: 40px; + } + + &__image { + width: 100%; + height: 100%; + display: block; + } + + &__title { + font-size: 12px; + font-weight: 500; + line-height: 18px; + color: #060b35; + margin-bottom: 4px; + text-align: start; + } + + &__subtitle { + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: #616070; + margin-bottom: 16px; + } + + &__activity, + &__price { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + } + + &__activity { + margin-bottom: 24px; + } + + &__review { + font-size: 10px; + font-weight: 400; + color: #060b35; + } + + &__price { + margin-bottom: 16px; + } + + &__sum-title { + font-size: 12px; + font-weight: 400; + line-height: 18px; + color: #616070; + } + &__sum { + font-size: 16px; + font-weight: 700; + line-height: 18px; + color: #060b35; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..e65d15e673 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import 'card'; +@import 'page'; +@import 'button'; +@import 'rating'; diff --git a/src/styles/page.scss b/src/styles/page.scss new file mode 100644 index 0000000000..13f9455200 --- /dev/null +++ b/src/styles/page.scss @@ -0,0 +1,6 @@ +.page { + font-family: Roboto, 'Inria Serif', serif; + margin: 0; + padding: 0; + box-sizing: border-box; +} diff --git a/src/styles/rating.scss b/src/styles/rating.scss new file mode 100644 index 0000000000..2bb79d53a2 --- /dev/null +++ b/src/styles/rating.scss @@ -0,0 +1,22 @@ +.rating { + display: flex; + flex-direction: row; + + &__star { + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: center; + } + + &__star:not(:last-child) { + margin-right: 4px; + } + + &__star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } + &__star:nth-child(5) { + background-image: url(../images/star.svg); + } +}