diff --git a/readme.md b/readme.md index acd5174814..a71a9615a4 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://1Vladislav13.github.io/layout_catalog/) +- [TEST REPORT LINK](https://1Vladislav13.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..80fc7250ed 100644 --- a/src/index.html +++ b/src/index.html @@ -12,7 +12,7 @@ href="https://fonts.gstatic.com" /> -

Catalog

+
+ + +
+
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+ Reviews: 5 +
+
+ Price: + $2,199 +
+ + buy + +
+
+ iMac apple +

+ 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..6f24173170 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,96 @@ +@use '../untils/variables'; + +.card { + padding: 32px 16px 16px; + display: flex; + flex-direction: column; + border: 1px solid #f3f3f3; + border-radius: 1px; + width: 200px; + transition: variables.$transition; + + &__img { + width: 160px; + height: 134px; + margin: 0 auto 40px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin-top: 0; + margin-bottom: 4px; + color: variables.$color-text-info; + transition: variables.$transition; + } + + &__code { + color: #616070; + margin-bottom: 16px; + font-size: 10px; + font-weight: 400; + line-height: 14px; + } + + &__reviews { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + font-size: 10px; + font-weight: 400; + line-height: 14px; + } + + &__reviews-text { + color: variables.$color-text-info; + } + + &__price-info { + display: flex; + justify-content: space-between; + font-size: 12px; + line-height: 18px; + margin-bottom: 16px; + color: #616070; + font-weight: 400; + } + + &__price-coast { + font-weight: 700; + font-size: 16px; + color: variables.$color-text-info; + } + + &__button { + height: 40px; + padding: 12px; + background-color: variables.$button-background-hover; + font-weight: 700; + font-size: 14px; + line-height: 16px; + color: #fff; + text-transform: uppercase; + text-align: center; + text-decoration: none; + border: 1px solid variables.$button-background-hover; + border-radius: 5px; + cursor: pointer; + transition: variables.$transition; + + &:hover { + background-color: variables.$button-background; + color: variables.$button-background-hover; + font-weight: 700; + } + } + + &:hover { + transform: scale(1.2); + } + + &:hover &__title { + color: variables.$card-title-hover; + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..9b30e0f581 --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,65 @@ +@use '../untils/variables'; + +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + + &__logo { + width: 40px; + height: 40px; + } + + &__nav { + display: flex; + align-items: center; + height: 60px; + } + + &__list { + display: flex; + margin: 0; + padding: 0; + list-style: none; + } + + &__list-item:not(:last-child) { + margin-right: 20px; + } + + &__item-link { + position: relative; + + display: flex; + align-items: center; + height: 60px; + + color: variables.$header-color-link; + text-decoration: none; + text-transform: uppercase; + transition: variables.$transition; + + &:hover { + color: variables.$header-color-blue; + } + + &.is-active { + color: variables.$header-color-blue; + + &::after { + content: ''; + + position: absolute; + bottom: 0; + left: 0; + + width: 100%; + height: 4px; + border-radius: 8px; + + background-color: variables.$header-color-blue; + } + } + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..db95b88020 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,35 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + } + + &__star:not(:last-child) { + margin-right: 4px; + } + + &--1 &__star:nth-child(-n + 1) { + background-image: url('../images/star-active.svg'); + } + + &--2 &__star:nth-child(-n + 2) { + background-image: url('../images/star-active.svg'); + } + + &--3 &__star:nth-child(-n + 3) { + background-image: url('../images/star-active.svg'); + } + + &--4 &__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); + } + + &--5 &__star:nth-child(-n + 5) { + background-image: url('../images/star-active.svg'); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..2e64e047cb 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,35 @@ +@use './untils/variables'; +@use './blocks/header.scss'; +@use './blocks/card.scss'; +@use './blocks/stars.scss'; + +* { + box-sizing: border-box; +} + body { margin: 0; + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; +} + +.catalog { + padding: 50px 40px; + display: grid; + grid-template-columns: variables.$width-column-grid; + gap: 46px 48px; + justify-content: center; + + @media (min-width: 488px) { + grid-template-columns: repeat(2, variables.$width-column-grid); + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, variables.$width-column-grid); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, variables.$width-column-grid); + } } diff --git a/src/styles/untils/_variables.scss b/src/styles/untils/_variables.scss new file mode 100644 index 0000000000..6975de14ee --- /dev/null +++ b/src/styles/untils/_variables.scss @@ -0,0 +1,8 @@ +$button-background: #fff; +$button-background-hover: #00acdc; +$color-text-info: #060b35; +$header-color-blue: #00acdc; +$header-color-link: #060b35; +$card-title-hover: #34568b; +$transition: all 0.3s; +$width-column-grid: 200px;