From 17f610982ad1d996a4082d58e8bb2ac9bccfdcde Mon Sep 17 00:00:00 2001 From: marushchak Date: Mon, 30 Dec 2024 18:07:32 +0200 Subject: [PATCH 1/3] add task solution --- src/index.html | 43 ++++++++++++++++- src/styles/index.scss | 106 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 148 insertions(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 43745cc17f..c62e8b357c 100644 --- a/src/index.html +++ b/src/index.html @@ -13,6 +13,47 @@ /> -

Product cards

+
+
+ Product-picture +
+ +

+ 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..8d909b3b23 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,109 @@ +@import 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'; + +$base-color: #060b35; +$light-color: #616070; +$btn-color-first: #00acdc; +$btn-color-second: #fff; + body { margin: 0; + font-family: Roboto, serif; + font-weight: 400; +} + +p { + margin: 0; +} + +.card { + box-sizing: border-box; + background-color: #fff; + border: 1px solid #f3f3f3; + border-radius: 5px; + width: 200px; + padding: 32px 16px 16px; + display: flex; + flex-direction: column; + font-size: 10px; + color: $base-color; + line-height: 18px; + &__picture-img { + height: 134px; + display: flex; + margin: 0 auto 40px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $base-color; + margin: 0 0 4px; + } + + &__code { + line-height: 14px; + color: $light-color; + margin-bottom: 16px; + } + + &__rating { + display: flex; + justify-content: space-between; + margin-bottom: 22px; + } + + &__price-wrap { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + } + + &__price-lable { + font-size: 12px; + color: $light-color; + } + &__price { + font-weight: 700; + font-size: 16px; + } + &__btn { + display: block; + color: $btn-color-second; + text-decoration: none; + border: 1px solid $btn-color-first; + background-color: $btn-color-first; + border-radius: 5px; + text-transform: uppercase; + font-weight: 700; + width: 100%; + height: 40px; + line-height: 40px; + font-size: 14px; + text-align: center; + &:hover { + background-color: $btn-color-second; + color: $btn-color-first; + } + } +} + +.stars { + display: flex; + &__star { + background-image: url(/images/star.svg); + background-position: center; + background-repeat: no-repeat; + width: 16px; + height: 16px; + margin-right: 4px; + } +} + +.stars--1 .stars__star:nth-child(-n + 1), +.stars--2 .stars__star:nth-child(-n + 2), +.stars--3 .stars__star:nth-child(-n + 3), +.stars--4 .stars__star:nth-child(-n + 4), +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url(/images/star-active.svg); } From 4602ffc52cc726a5c1fe1365ec3f24258b0d8ca6 Mon Sep 17 00:00:00 2001 From: marushchak Date: Mon, 30 Dec 2024 18:08:55 +0200 Subject: [PATCH 2/3] update linck in readme.md --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index b1f43ed970..c639d4b4ba 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://MarushchakM.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://MarushchakM.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. From 643d525dc976d6b5ad9b57d54976fe9f88956813 Mon Sep 17 00:00:00 2001 From: marushchak Date: Mon, 30 Dec 2024 18:33:56 +0200 Subject: [PATCH 3/3] fixed the mistakes --- src/styles/blocks/card.scss | 72 +++++++++++++++++++++++ src/styles/blocks/stars.scss | 19 ++++++ src/styles/index.scss | 100 +------------------------------- src/styles/utils/variables.scss | 4 ++ 4 files changed, 98 insertions(+), 97 deletions(-) create mode 100644 src/styles/blocks/card.scss create mode 100644 src/styles/blocks/stars.scss create mode 100644 src/styles/utils/variables.scss diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..c1aab006f8 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,72 @@ +.card { + box-sizing: border-box; + background-color: #fff; + border: 1px solid #f3f3f3; + border-radius: 5px; + width: 200px; + padding: 32px 16px 16px; + display: flex; + flex-direction: column; + font-size: 10px; + color: $base-color; + line-height: 18px; + &__picture-img { + height: 134px; + display: flex; + margin: 0 auto 40px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $base-color; + margin: 0 0 4px; + } + + &__code { + line-height: 14px; + color: $light-color; + margin-bottom: 16px; + } + + &__rating { + display: flex; + justify-content: space-between; + margin-bottom: 22px; + } + + &__price-wrap { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + } + + &__price-lable { + font-size: 12px; + color: $light-color; + } + &__price { + font-weight: 700; + font-size: 16px; + } + &__btn { + display: block; + color: $btn-color-second; + text-decoration: none; + border: 1px solid $btn-color-first; + background-color: $btn-color-first; + border-radius: 5px; + text-transform: uppercase; + font-weight: 700; + width: 100%; + height: 40px; + line-height: 40px; + font-size: 14px; + text-align: center; + &:hover { + background-color: $btn-color-second; + color: $btn-color-first; + } + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..d7eccb351e --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,19 @@ +.stars { + display: flex; + &__star { + background-image: url(../images/star.svg); + background-position: center; + background-repeat: no-repeat; + width: 16px; + height: 16px; + margin-right: 4px; + } +} + +.stars--1 .stars__star:nth-child(-n + 1), +.stars--2 .stars__star:nth-child(-n + 2), +.stars--3 .stars__star:nth-child(-n + 3), +.stars--4 .stars__star:nth-child(-n + 4), +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 8d909b3b23..76826d2871 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,9 +1,5 @@ @import 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'; - -$base-color: #060b35; -$light-color: #616070; -$btn-color-first: #00acdc; -$btn-color-second: #fff; +@import './utils/variables'; body { margin: 0; @@ -15,95 +11,5 @@ p { margin: 0; } -.card { - box-sizing: border-box; - background-color: #fff; - border: 1px solid #f3f3f3; - border-radius: 5px; - width: 200px; - padding: 32px 16px 16px; - display: flex; - flex-direction: column; - font-size: 10px; - color: $base-color; - line-height: 18px; - &__picture-img { - height: 134px; - display: flex; - margin: 0 auto 40px; - } - - &__title { - font-weight: 500; - font-size: 12px; - line-height: 18px; - color: $base-color; - margin: 0 0 4px; - } - - &__code { - line-height: 14px; - color: $light-color; - margin-bottom: 16px; - } - - &__rating { - display: flex; - justify-content: space-between; - margin-bottom: 22px; - } - - &__price-wrap { - display: flex; - justify-content: space-between; - margin-bottom: 16px; - } - - &__price-lable { - font-size: 12px; - color: $light-color; - } - &__price { - font-weight: 700; - font-size: 16px; - } - &__btn { - display: block; - color: $btn-color-second; - text-decoration: none; - border: 1px solid $btn-color-first; - background-color: $btn-color-first; - border-radius: 5px; - text-transform: uppercase; - font-weight: 700; - width: 100%; - height: 40px; - line-height: 40px; - font-size: 14px; - text-align: center; - &:hover { - background-color: $btn-color-second; - color: $btn-color-first; - } - } -} - -.stars { - display: flex; - &__star { - background-image: url(/images/star.svg); - background-position: center; - background-repeat: no-repeat; - width: 16px; - height: 16px; - margin-right: 4px; - } -} - -.stars--1 .stars__star:nth-child(-n + 1), -.stars--2 .stars__star:nth-child(-n + 2), -.stars--3 .stars__star:nth-child(-n + 3), -.stars--4 .stars__star:nth-child(-n + 4), -.stars--5 .stars__star:nth-child(-n + 5) { - background-image: url(/images/star-active.svg); -} +@import './blocks/card'; +@import './blocks/stars'; diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..85330e0dbc --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,4 @@ +$base-color: #060b35; +$light-color: #616070; +$btn-color-first: #00acdc; +$btn-color-second: #fff;