From d5430b268d258f803e54308e69b8bf5e625dc022 Mon Sep 17 00:00:00 2001 From: Kostya Oliinyk Date: Tue, 17 Dec 2024 01:55:05 +0200 Subject: [PATCH] add solution --- readme.md | 4 +- src/index.html | 55 +++++++++++++++++- src/styles/index.scss | 131 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 185 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index b1f43ed970..d338e6d0f6 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://KOliinyk.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://KOliinyk.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..6c92f66969 100644 --- a/src/index.html +++ b/src/index.html @@ -7,12 +7,63 @@ content="width=device-width, initial-scale=1.0" /> Product cards + + + - -

Product cards

+ +
+ card +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..55d6212b3c 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,132 @@ -body { +html { + font-family: Roboto, sans-serif; +} + +p, +h3 { + margin: 0; + padding: 0; +} + +.body { margin: 0; + padding: 0; + + --white: #fff; + --blue: #00acdc; +} + +.card { + width: 200px; + box-sizing: border-box; + padding: 32px 16px 16px; + border-radius: 5px; + border: 1px solid #f3f3f3; + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin-bottom: 4px; + } + + &__info { + margin-top: 4px; + font-weight: 400; + font-size: 10px; + line-height: 14px; + display: flex; + } + + &__image { + margin: 0 auto 40px; + display: block; + width: 160px; + height: 134px; + } +} + +.reviews { + min-width: 166px; + display: flex; + margin: 16px 0 24px; + + &__text { + font-size: 10px; + font-weight: 400; + line-height: 16px; + display: flex; + justify-content: space-between; + padding-left: 17px; + } +} + +.stars { + min-width: 60%; + line-height: 16px; + display: flex; + justify-content: space-between; + + &__star { + width: 60%; + line-height: 16px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + } + + &--0 &__star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + background-repeat: no-repeat; + } +} + +.price { + width: 166px; + line-height: 18px; + display: flex; + justify-content: space-between; + margin: 24px 0 16px; + + &__title { + font-size: 12px; + font-weight: 400; + line-height: 18px; + justify-content: space-between; + } + + &__number { + font-size: 16px; + font-weight: 700; + line-height: 18px; + } +} + +.footer { + margin: 16px 0 0; + width: 166px; + height: 40px; + background: var(--blue); + border-radius: 5px; + + &__button { + margin: 12px 70px; + width: 27px; + line-height: 16px; + font-size: 14px; + font-weight: 700; + display: inline-block; + color: var(--white); + text-decoration: none; + } + + &:hover { + background: var(--white); + border-radius: 5px; + border: 1px solid var(--blue); + } + + &__button:hover { + color: var(--blue); + text-decoration: none; + } }