diff --git a/readme.md b/readme.md index b1f43ed970..6d0a83ef22 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://serhiy23471.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://serhiy23471.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) diff --git a/src/index.html b/src/index.html index 43745cc17f..06431e25f1 100644 --- a/src/index.html +++ b/src/index.html @@ -7,12 +7,64 @@ 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/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..9b60ca77ce --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,85 @@ +.card { + width: 200px; + + padding: 0 16px; + border-radius: 5px; + border: 1px solid #f3f3f3; +} + +.card__img { + display: block; + margin: 32px auto 40px; + width: 160px; + height: 134px; +} + +.card__name { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: #060b35; + margin-bottom: 4px; +} + +.card__code { + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: #616070; +} + +.card__review { + display: flex; + + font-size: 10px; + font-weight: 400; + + align-items: center; + justify-content: space-between; + margin: 16px 0 0; +} + +.card__price { + display: flex; + justify-content: space-between; + margin: 24px 0 16px; +} + +.card__price-label { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: #616070; +} + +.card__price-value { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: #060b35; +} + +.button { + display: block; + height: 40px; + align-items: center; + text-align: center; + background-color: #00acdc; + border-radius: 5px; + border: 1px solid transparent; + padding: 12px 0; + margin: 16px 0; + + color: #fff; + font-weight: 700; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; +} + +.button:hover { + border-radius: 5px; + border: 1px solid #00acdc; + background-color: #fff; + color: #00acdc; +} diff --git a/src/styles/blocks/reset.scss b/src/styles/blocks/reset.scss new file mode 100644 index 0000000000..302fc6e5ef --- /dev/null +++ b/src/styles/blocks/reset.scss @@ -0,0 +1,7 @@ +body, +div, +p, +h2, +a { + margin: 0; +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..b7df3ff1a3 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,29 @@ +.stars { + display: flex; + align-items: center; +} + +.stars__star { + height: 16px; + width: 16px; + margin: 0 2px; + background-repeat: no-repeat; + background-position: center; + background-image: url(../images/star.svg); +} + +.stars__star:last-child { + margin-right: 0; +} + +.stars__star:first-child { + margin-left: 0; +} + +.stars--5 > .stars__star, +.stars--1 > .stars__star:nth-child(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) { + background-image: url(../images/star-active.svg); +} diff --git a/src/styles/blocks/style.scss b/src/styles/blocks/style.scss new file mode 100644 index 0000000000..b36941be33 --- /dev/null +++ b/src/styles/blocks/style.scss @@ -0,0 +1,9 @@ +* { + box-sizing: border-box; +} + +html { + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..09e6628a02 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import 'blocks/card'; +@import 'blocks/stars'; +@import 'blocks/style'; +@import 'blocks/reset';