diff --git a/readme.md b/readme.md index b1f43ed970..525723ef66 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://KrawczykDamiann.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://KrawczykDamiann.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..850cf35cf2 100644 --- a/src/index.html +++ b/src/index.html @@ -1,6 +1,28 @@ + + + + + -

Product cards

+
+ Product + +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+ +
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + buy + +
diff --git a/src/styles/_button.scss b/src/styles/_button.scss new file mode 100644 index 0000000000..620211bf05 --- /dev/null +++ b/src/styles/_button.scss @@ -0,0 +1,24 @@ +.button { + @include center; + @include roboto700; + + height: 40px; + width: 100%; + margin-top: 16px; + border-radius: 5px; + border-color: 1px solid #00acdc; + text-decoration: none; + cursor: pointer; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + color: #fff; + background-color: #00acdc; + box-sizing: border-box; + + &:hover { + background-color: #fff; + border: 1px solid #00acdc; + color: #00acdc; + } +} diff --git a/src/styles/_card.scss b/src/styles/_card.scss new file mode 100644 index 0000000000..f6ae4ee714 --- /dev/null +++ b/src/styles/_card.scss @@ -0,0 +1,37 @@ +.card { + @include center; + + box-sizing: border-box; + padding: 16px; + border: 1px solid #f3f3f3; + border-radius: 5px; + flex-direction: column; + width: 200px; + + &__image { + margin-top: 16px; + width: 160px; + height: 134px; + } + + &__title { + margin-top: 40px; + + &-text { + @include roboto500; + + font-size: 12px; + line-height: 18px; + color: #060b35; + } + + &-product-code { + @include roboto400; + + color: #616070; + font-size: 10px; + line-height: 14px; + margin-top: 4px; + } + } +} diff --git a/src/styles/_mixins.scss b/src/styles/_mixins.scss new file mode 100644 index 0000000000..c8d098bcd8 --- /dev/null +++ b/src/styles/_mixins.scss @@ -0,0 +1,23 @@ +@mixin center { + display: flex; + align-items: center; + justify-content: center; +} + +@mixin roboto400 { + font-family: Roboto, serif; + font-weight: 400; + font-style: normal; +} + +@mixin roboto500 { + font-family: Roboto, serif; + font-weight: 500; + font-style: normal; +} + +@mixin roboto700 { + font-family: Roboto, serif; + font-weight: 700; + font-style: normal; +} diff --git a/src/styles/_price.scss b/src/styles/_price.scss new file mode 100644 index 0000000000..d15a1ba7f4 --- /dev/null +++ b/src/styles/_price.scss @@ -0,0 +1,22 @@ +.price { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 24px; + width: 100%; + + &__text { + @include roboto400; + + color: #616070; + font-size: 12px; + } + + &__sum { + @include roboto700; + + color: #060b35; + line-height: 18px; + font-size: 16px; + } +} diff --git a/src/styles/_stars.scss b/src/styles/_stars.scss new file mode 100644 index 0000000000..e56eaf0d1c --- /dev/null +++ b/src/styles/_stars.scss @@ -0,0 +1,34 @@ +.stars { + display: flex; + justify-content: space-between; + align-items: flex-end; + line-height: 16px; + width: 100%; + margin-top: 16px; + + &__list { + @include center; + } + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + justify-content: space-between; + background-image: url('../images/star-active.svg'); + background-repeat: no-repeat; + } + + &__star:nth-child(n + 5) { + background-image: url('../images/star.svg'); + } + + &__reviews { + @include roboto400; + + justify-content: space-between; + line-height: 14px; + color: #060b35; + font-size: 10px; + } +} diff --git a/src/styles/index.css b/src/styles/index.css new file mode 100644 index 0000000000..b967385d1c --- /dev/null +++ b/src/styles/index.css @@ -0,0 +1,132 @@ +.card { + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + padding: 16px; + border: 1px solid #f3f3f3; + border-radius: 5px; + flex-direction: column; + width: 200px; +} + +.card__image { + margin-top: 16px; + width: 160px; + height: 134px; +} + +.card__title { + margin-top: 40px; +} + +.card__title-text { + font-family: Roboto, serif; + font-weight: 500; + font-style: normal; + font-size: 12px; + line-height: 18px; + color: #060b35; +} + +.card__title-product-code { + font-family: Roboto, serif; + font-weight: 400; + font-style: normal; + color: #616070; + font-size: 10px; + line-height: 14px; + margin-top: 4px; +} + +.stars { + display: flex; + align-items: center; + justify-content: center; + line-height: 16px; + width: 100%; + margin-top: 17px; +} + +.stars__star { + width: 16px; + height: 16px; + margin-right: 4px; + justify-content: space-between; + background-image: url('../images/star-active.svg'); + background-repeat: no-repeat; +} + +.stars__star:nth-child(n + 5) { + background-image: url('../images/star.svg'); +} + +.stars__reviews { + font-family: Roboto, serif; + font-weight: 400; + font-style: normal; + justify-content: space-between; + line-height: 14px; + color: #060b35; + font-size: 10px; +} + +.price { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 24px; + width: 100%; +} + +.price__text { + font-family: Roboto, serif; + font-weight: 400; + font-style: normal; + color: #616070; + font-size: 12px; +} + +.price__sum { + font-family: Roboto, serif; + font-weight: 700; + font-style: normal; + color: #060b35; + line-height: 18px; + font-size: 16px; +} + +.button { + display: flex; + align-items: center; + justify-content: center; + font-family: Roboto, serif; + font-weight: 700; + font-style: normal; + height: 40px; + width: 100%; + margin-top: 16px; + border-radius: 5px; + border-color: 1px solid #00acdc; + text-decoration: none; + cursor: pointer; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + color: #fff; + background-color: #00acdc; + box-sizing: border-box; +} + +.button:hover { + background-color: #fff; + border: 1px solid #00acdc; + color: #00acdc; +} + +body { + font-family: Roboto, serif; + font-weight: 400; + font-style: normal; + margin: 0; +} diff --git a/src/styles/index.css.map b/src/styles/index.css.map new file mode 100644 index 0000000000..daa91cd9e5 --- /dev/null +++ b/src/styles/index.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["_card.scss","_mixins.scss","_stars.scss","_price.scss","_button.scss","index.scss"],"names":[],"mappings":"AAAA;ECCE;EACA;EACA;EDAA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;AAGF;EACE;;AAEA;ECNF;EACA;EACA;EDOI;EACA;EACA;;AAGF;ECpBF;EACA;EACA;EDqBI;EACA;EACA;EACA;;;AEjCN;EDCE;EACA;EACA;ECAA;EACA;EACA;;AAEA;EACE;EACA;EACA;EACA;EACA;EACA;;AAGF;EACE;;AAGF;EDbA;EACA;EACA;ECcE;EACA;EACA;EACA;;;AC1BJ;EACE;EACA;EACA;EACA;EACA;;AAEA;EFAA;EACA;EACA;EECE;EACA;;AAGF;EFKA;EACA;EACA;EEJE;EACA;EACA;;;ACnBJ;EHCE;EACA;EACA;EAgBA;EACA;EACA;EGjBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;EACA;;;ACfJ;EJCE;EACA;EACA;EIAA","file":"index.css"} \ No newline at end of file diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..5d516ece22 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,11 @@ +@import './mixins'; +@import './card'; +@import './stars'; +@import './price'; +@import './button'; + body { + @include roboto400; + margin: 0; }