diff --git a/readme.md b/readme.md index b1f43ed970..99bbc43ded 100644 --- a/readme.md +++ b/readme.md @@ -23,8 +23,8 @@ 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://katiabahrin.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://katiabahrin.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. diff --git a/src/index.html b/src/index.html index 43745cc17f..dfdc9de66d 100644 --- a/src/index.html +++ b/src/index.html @@ -7,12 +7,61 @@ content="width=device-width, initial-scale=1.0" /> Product cards + + + + -

Product cards

+
+ product-img +

+ 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..e6c8a6155f --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,84 @@ +.card { + box-sizing: border-box; + width: $card-width; + border: 1px solid $card-border-color; + color: $card-font-color; + padding: 32px $card-horiz-margin 0; + + &__img { + display: block; + width: $img-width; + height: $img-height; + margin: 0 auto 40px; + } + + &__title { + margin: 0; + font-size: $card-title-size; + line-height: $product-title-line-height; + font-weight: $card-title-weight; + } + + &__code { + font-size: $product-code-size; + color: $product-code-color; + margin-top: 4px; + margin-bottom: 16px; + line-height: 14px; + } + + &__price { + display: flex; + justify-content: space-between; + line-height: 18px; + margin-top: 24px; + } + + &__price-title { + margin: 0; + font-size: 12px; + color: $product-code-color; + } + + &__price-value { + margin: 0; + font-size: 16px; + font-weight: 700; + } + + &__link { + box-sizing: border-box; + text-decoration: none; + height: $cta-height; + background-color: $cta-color; + display: flex; + width: 100%; + justify-content: center; + align-items: center; + color: $cta-font-color; + font-size: $cta-font-size; + line-height: $cta-line-height; + font-weight: $cta-font-weight; + border-radius: $cta-border-radius; + margin: 16px 0; + text-transform: uppercase; + + &:hover { + border: 1px solid $cta-color; + background-color: $cta-hover-color; + color: $cta-color; + } + } + + &__ranking { + height: 16px; + display: flex; + justify-content: space-between; + } + + &__reviews { + margin: 0; + line-height: 14px; + font-size: $reviews-font-size; + } +} diff --git a/src/styles/blocks/main.scss b/src/styles/blocks/main.scss new file mode 100644 index 0000000000..914079609d --- /dev/null +++ b/src/styles/blocks/main.scss @@ -0,0 +1,4 @@ +body { + margin: 0; + font-family: Roboto, system-ui; +} diff --git a/src/styles/blocks/star.scss b/src/styles/blocks/star.scss new file mode 100644 index 0000000000..d87df0d2f1 --- /dev/null +++ b/src/styles/blocks/star.scss @@ -0,0 +1,26 @@ +.stars { + display: flex; + flex-direction: row; + padding: 0; + margin: 0; + line-height: 16px; +} + +.stars__star { + box-sizing: border-box; + list-style-type: none; + background: url(../images/star.svg) no-repeat center center; + background-position: center; + background-repeat: no-repeat; + height: 16px; + width: 16px; + margin-right: 4px; +} + +.stars__star:last-child { + margin-right: 0; +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background: url(../images/star-active.svg) no-repeat center center; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..456831ddcb 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,4 @@ -body { - margin: 0; -} +@import './utils/variables'; +@import './blocks/card'; +@import './blocks/star'; +@import './blocks/main'; diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..09753bdb15 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,20 @@ +$card-title-size: 12px; +$card-title-weight: 500; +$card-font-color: #060b35; +$card-width: 200px; +$img-width: 160px; +$img-height: 134px; +$card-horiz-margin: 16px; +$product-code-size: 10px; +$product-code-color: #616070; +$cta-color: #00acdc; +$cta-hover-color: #fff; +$cta-height: 40px; +$cta-font-color: #fff; +$cta-font-size: 14px; +$cta-font-weight: 700; +$cta-line-height: 16px; +$cta-border-radius: 5px; +$reviews-font-size: 10px; +$card-border-color: #f3f3f3; +$product-title-line-height: 18px;