diff --git a/readme.md b/readme.md index 874ca70d97..35aec3888a 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` anymore (nav links should have `#060b35` color) - add the class `is-active` to the first link (`Apple`) in the navigation -- use `
` tag for cards container +- use `
` tag for cards container - use the grid for cards with different numbers of columns: - 1 for the smaller screens - 2 starting at `488px` @@ -33,8 +33,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ## Checklist ❗️ Replace `` with your GitHub username and copy the links to the `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_catalog/) -- [TEST REPORT LINK](https://.github.io/layout_catalog/report/html_report/) +- [DEMO LINK](https://Dariya-Goncharovskaya.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Dariya-Goncharovskaya.github.io/layout_catalog/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 9cff78eeb7..7ee4dafc71 100644 --- a/src/index.html +++ b/src/index.html @@ -17,11 +17,367 @@ /> -

Catalog

+
+ + moyo__logo + + +
+
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
+ Product image +

+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +

+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+ Price: + $2,199 +
+ + BUY + +
+
diff --git a/src/styles/blocks/cards.scss b/src/styles/blocks/cards.scss new file mode 100644 index 0000000000..ee5ea51b6f --- /dev/null +++ b/src/styles/blocks/cards.scss @@ -0,0 +1,126 @@ +.container { + display: grid; + justify-content: center; + grid-template-columns: repeat(1, 200px); + gap: 46px 48px; + padding: 50px 40px; + margin: 0 auto; + width: 100%; + + @media (min-width: 488px) { + grid-template-columns: repeat(2, 200px); + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, 200px); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, 200px); + } +} + +.card { + width: 200px; + padding: 32px 16px 16px; + border: 1px solid $color-button-border; + border-radius: 5px; + background: $button-text-color; + transition: transform 300ms ease; + transform: scale(1); + + &:hover { + transform: scale(1.2); + } + + &__image { + position: relative; + display: block; + width: 160px; + height: 134px; + margin: 0 auto 40px; + } + + &__title { + font-weight: 500; + margin: 0 0 4px; + font-size: 12px; + line-height: 18px; + color: $title-color; + transition: color 300ms ease; + + .card:hover & { + color: #34568b; + } + } + + &__product-code { + font-weight: 400; + font-size: 10px; + line-height: 14px; + } + + &__review { + display: flex; + justify-content: space-between; + margin: 0; + } + + &__between { + display: flex; + justify-content: space-between; + padding: 16px 0 24px; + } + + &__reviews { + display: flex; + line-height: 14px; + font-size: 10px; + font-weight: 400; + color: $title-color; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + line-height: 18px; + + &-label { + font-size: 12px; + } + + &-value { + font-size: 16px; + font-weight: bold; + color: $title-color; + } + } + + &__buy { + display: block; + place-content: center center; + text-align: center; + + box-sizing: border-box; + height: 40px; + border: 1px solid $main-color; + border-radius: 5px; + + font-size: 14px; + line-height: 16px; + color: $button-text-color; + font-weight: 700; + text-decoration: none; + background-color: $main-color; + transition: + background-color 300ms ease, + color 300ms ease; + + &[data-qa='card-hover']:hover { + color: $main-color; + background-color: $button-text-color; + } + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..60cfbb8f17 --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,63 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 50px; + background: $button-text-color; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); + + &__link { + height: 40px; + width: 40px; + } + + &__nav-list { + display: flex; + padding: 0; + margin: 0; + list-style: none; + } + + &__nav-item { + margin-left: 20px; + + &:first-child { + margin-left: 0; + } + } + + &__nav-link { + display: flex; + justify-content: space-around; + align-items: center; + text-decoration: none; + white-space: nowrap; + color: $title-color; + height: 60px; + font-size: 12px; + font-weight: 500; + text-transform: uppercase; + + position: relative; + transition: color 300ms ease; + + &[data-qa='nav-hover']:hover { + color: $main-color; + } + + &.is-active { + color: $main-color; + + &::after { + content: ''; + height: 4px; + background-color: $main-color; + position: absolute; + bottom: 0; + right: 0; + left: 0; + border-radius: 2px; + } + } + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..daa4ac27de --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,16 @@ +.stars { + display: flex; + + &__star { + height: 16px; + width: 16px; + margin-right: 4px; + background-repeat: no-repeat; + background-position: center; + background-image: url(/src/images/star.svg); + } + + &--4 &__star:nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss deleted file mode 100644 index 293d3b1f13..0000000000 --- a/src/styles/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -body { - margin: 0; -} diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..0b8dddc313 --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,20 @@ +@import '/src/styles/utils/variables'; +@import '/src/styles/blocks/header'; +@import '/src/styles/blocks/cards'; +@import '/src/styles/blocks/stars'; + +* { + box-sizing: border-box; +} + +html { + font-family: Roboto, sans-serif; + font-size: 10px; + line-height: 14px; + color: $product-code-color; + box-sizing: border-box; +} + +body { + margin: 0; +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..f075d1bcf2 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,8 @@ +$main-color: #00acdc; +$font-weight-regular: 400; +$font-weight-semi-bold: 500; +$font-weight-bold: 700; +$title-color: #060b35; +$product-code-color: #616070; +$color-button-border: #f3f3f3; +$button-text-color: white;