diff --git a/readme.md b/readme.md index b1f43ed970..da9f2e6538 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://anastat1on.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://anastat1on.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..d57b99a5b2 100644 --- a/src/index.html +++ b/src/index.html @@ -9,10 +9,56 @@ Product cards + -

Product cards

+
+ Apple iMac computer +

+ 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..f277a56bc3 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,81 @@ +.card { + width: 200px; + height: auto; + padding: 32px 16px 16px; + + border: 1px solid rgb(214, 212, 212); + border-radius: 5px; + + box-sizing: border-box; + + display: flex; + flex-direction: column; + justify-content: space-between; + + &__product-image-mac { + height: auto; + width: 100%; + display: block; + } + + &__item-name { + font-size: 12px; + font-weight: 500; + margin: 34 0 0; + } + + &__item-code { + font-size: 10px; + color: $light-color-text; + margin: 4 0; + } +} + +.review { + display: flex; + justify-content: space-between; + align-items: center; + + &__comments { + font-size: 10px; + line-height: 14px; + } +} + +.price { + display: flex; + justify-content: space-between; + align-items: center; + + &__item { + color: $light-color-text; + font-size: 12px; + } + + &__amount { + font-size: 16px; + font-weight: 700; + } +} + +.buy-button { + height: 40px; + border-radius: 5px; + + color: white; + text-transform: uppercase; + + background: $buy-button-color; + + font-size: 14px; + font-weight: 700; + text-align: center; + align-content: center; + + &:hover { + border: 1px solid $buy-button-color; + background-color: white; + color: $buy-button-color; + box-sizing: border-box; + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..5681150fbe --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,16 @@ +.review__star { + display: flex; + + &-stars { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + margin-right: 4px; + } + + & .review__star-stars:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..91f044781c 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,11 @@ +@import './utils/variables'; +@import './blocks/card'; +@import './blocks/stars'; + body { margin: 0; + + font-family: $main-font; + line-height: $main-line-height; + font-weight: $main-font-weight; } diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..9757107652 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,6 @@ +$main-font: 'Roboto', 'Arial', sans-serif; +$main-color-text: rgba(6, 11, 53, 1); +$main-font-weight: 400; +$light-color-text: rgba(97, 96, 112, 1); +$buy-button-color: rgba(0, 172, 220, 1); +$main-line-height: 18px;