From 84c43b7628caf4d4f9902d5fc10d015aa5395ad2 Mon Sep 17 00:00:00 2001 From: "artur.manuilenko" Date: Mon, 23 Dec 2024 19:14:57 +0200 Subject: [PATCH 1/2] develop --- src/index.html | 53 +++++++++++++++++++++++- src/styles/card.scss | 85 +++++++++++++++++++++++++++++++++++++++ src/styles/index.scss | 7 +++- src/styles/stars.scss | 18 +++++++++ src/styles/variables.scss | 3 ++ 5 files changed, 164 insertions(+), 2 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/variables.scss diff --git a/src/index.html b/src/index.html index 43745cc17f..63cddaf9c5 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

+
+ desktop +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..2e1554c9c5 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,85 @@ +@import './variables'; + +.card { + box-sizing: border-box; + border: 1px solid #f3f3f3; + width: 200px; + padding: 32px 16px 16px; + font-family: Roboto, sans-serif; + + &__image { + width: 160px; + height: 134px; + display: block; + margin: auto auto 40px; + } + + &__title { + color: $color-main; + margin-bottom: 4px; + font-size: 12px; + font-weight: 500; + line-height: 18px; + } + + &__code { + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $color-secondary; + margin-bottom: 16px; + } + + &__review { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + } + + &__count { + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $color-main; + } + + &__price { + display: flex; + justify-content: space-between; + margin-bottom: 16px; + } + + &__description { + font-size: 12px; + font-weight: 400; + line-height: 18px; + color: $color-secondary; + } + + &__value { + font-size: 16px; + font-weight: 700; + line-height: 18px; + color: $color-main; + } + + &__button { + width: 100%; + text-transform: uppercase; + background-color: $blue-accent; + color: #fff; + border-radius: 5px; + padding: 12px 0; + border: 1px solid $blue-accent; + font-size: 14px; + font-weight: 700; + + &:hover { + color: $blue-accent; + background-color: #fff; + + cursor: pointer; + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..c24dcf08c3 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,8 @@ -body { +@import './stars'; +@import './card'; + +body, +h2, +p { margin: 0; } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..b0a84f20d5 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,18 @@ +.stars { + display: flex; + + &__star { + background-image: url('../images/star.svg'); + background-repeat: no-repeat; + background-position: 50%; + margin-right: 4px; + width: 16px; + height: 16px; + } + + @for $activeStar from 1 through 4 { + &__star:nth-child(-n + #{$activeStar}) { + background-image: url('../images/star-active.svg'); + } + } +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..405672d67c --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,3 @@ +$color-main: #060b35; +$color-secondary: #616070; +$blue-accent: #00acdc; From 13fdb06d597f02349e7e44b1c1aeaab2c8e37fd0 Mon Sep 17 00:00:00 2001 From: "artur.manuilenko" Date: Mon, 23 Dec 2024 19:16:54 +0200 Subject: [PATCH 2/2] add readme --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index b1f43ed970..62f0789667 100644 --- a/readme.md +++ b/readme.md @@ -23,13 +23,13 @@ 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://manuilenkoart.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://manuilenkoart.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. -- [ ] there 2 BEM blocks `card` and `stars` each in their own file -- [ ] SCSS Nesting is used for `elements`, `modifiers` and `pseudo-classes` -- [ ] SCSS Variables are used for main values and placed in a **separate file** -- [ ] all `stars--N` modifiers work as expected (Highlight first `N` stars) -- [ ] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules) +- [x] there 2 BEM blocks `card` and `stars` each in their own file +- [x] SCSS Nesting is used for `elements`, `modifiers` and `pseudo-classes` +- [x] SCSS Variables are used for main values and placed in a **separate file** +- [x] all `stars--N` modifiers work as expected (Highlight first `N` stars) +- [x] Code follows all the [Code Style Rules ❗️](https://mate-academy.github.io/layout_task-guideline/html-css-code-style-rules)