diff --git a/readme.md b/readme.md index b1f43ed970..8b6e7e1e9a 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://chrislockwoodfl.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://chrislockwoodfl.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..79cae613bf 100644 --- a/src/index.html +++ b/src/index.html @@ -11,8 +11,49 @@ rel="stylesheet" href="./styles/index.scss" /> + +

Product cards

+
+
+
+ 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..f8284ca114 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,6 @@ +.card { + width: 198px; + border: 1px solid #f3f3f3; + border-radius: 5px; + margin: auto; /* center card horizontally and vertically */ +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..154d9bb43e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,121 @@ +@use 'stars'; +@use 'card'; + +$light-text: #616070; +$dark-text: #060b35; +$button-color: #00acdc; + body { margin: 0; + font-family: Roboto, sans-serif; + font-size: 12px; + color: $dark-text; +} + +.product-image { + width: 160px; + height: 134px; + background-size: 160px 134px; + background-image: url('../images/imac.jpeg'); + background-position: center; + margin-top: 32.5px; + margin-left: auto; + margin-right: auto; +} + +.product-name { + margin-top: 40px; + padding-left: 16px; + padding-right: 15px; + font-weight: 500; + line-height: 18px; + color: $dark-text; +} + +.product-code { + font-weight: 400; + font-size: 10px; + color: $light-text; + line-height: 14px; + padding-top: 4px; + padding-left: 16px; +} + +.reviews-box { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + padding-top: 16px; + padding-left: 16px; + padding-right: 16px; + margin-bottom: 0; +} + +.flex-container { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.reviews { + font-weight: 400; + font-size: 10px; + padding-top: 3px; +} + +.price-box { + margin-top: 0; + margin-bottom: 0; + display: flex; + justify-content: space-between; + align-items: center; + padding: 24px 16px 15px; +} + +.price-label { + font-weight: 400; + font-size: 12px; + color: $light-text; + line-height: 18px; + padding-top: 0; +} + +.price { + font-weight: 900; + font-size: 16px; + line-height: 18px; + color: black; +} + +.buy-box { + width: 166px; + height: 40px; + background-color: $button-color; + color: white; + font-weight: 1000; + font-size: 14px; + line-height: 16px; + border-radius: 5px; + display: flex; + align-items: center; + margin-top: 1px; + margin-left: auto; + margin-right: auto; + padding-top: 0; +} + +.buy-box:hover { + background-color: white; + color: $button-color; + border: 1px solid $button-color; + width: 164px; + height: 38px; + font-weight: 1000; + line-height: 16px; +} + +.buy-link { + margin: 0 auto; } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..40f29f669b --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,24 @@ +.stars { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.star { + width: 16px; + height: 16px; + background-position: center; + background-repeat: no-repeat; + background-image: url('../images/star-active.svg'); + margin-right: 4px; +} + +.star-off { + width: 16px; + height: 16px; + background-position: center; + background-repeat: no-repeat; + background-image: url('../images/star.svg'); + margin-right: 4px; +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..5d16bd9a24 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,3 @@ +$light-text: #616070; +$dark-text: #060b35; +$button-color: #00acdc;