diff --git a/readme.md b/readme.md index acd5174814..ba4fd2136d 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://RomaPleshenko.github.io/layout_catalog/) +- [TEST REPORT LINK](https://RomaPleshenko.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..38c0eef268 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,587 @@ -

Catalog

+
+ + +
+ +
+
+
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+ +
+
+ APPLE A1419 iMac 27 +
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+
+ + +
+
+
diff --git a/src/styles/_base.scss b/src/styles/_base.scss new file mode 100644 index 0000000000..b7488a2fb9 --- /dev/null +++ b/src/styles/_base.scss @@ -0,0 +1,15 @@ +@use 'variables' as *; + +:root { + --main-color: #{$main-color}; +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 500; +} diff --git a/src/styles/_card.scss b/src/styles/_card.scss new file mode 100644 index 0000000000..7d44fa0820 --- /dev/null +++ b/src/styles/_card.scss @@ -0,0 +1,124 @@ +@use 'variables' as *; + +.card { + width: $card-width; + border: $card-border; + border-radius: $card-radius; + padding: $card-padding; + padding-top: $card-size * 2; + + display: flex; + flex-direction: column; + justify-content: space-between; + + transition: transform 300ms ease; + + &:hover { + transform: scale(1.2); + position: relative; + margin: -10px; + z-index: 1; + } + + &__image-wrapper { + width: 160px; + height: 134px; + margin: 0 auto; + + .card__image { + width: 100%; + height: 100%; + object-fit: contain; + } + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $color-text-primary; + padding-top: 40px; + margin-bottom: 4px; + transition: color 300ms ease; + } + + &:hover &__title { + color: #34568b; + } + + &__code { + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $color-text-muted; + margin-bottom: $card-size; + } + + &__rating { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__reviews { + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $color-text-primary; + } + + &__footer { + display: flex; + flex-direction: column; + gap: $card-size; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + } + + &__price-label { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: $color-text-muted; + } + + &__price-value { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $color-text-primary; + } + + &__button { + display: flex; + align-items: center; + justify-content: center; + text-decoration: none; + width: 100%; + height: 40px; + color: $color-button-text; + background-color: $color-button; + border-radius: 5px; + border: 1px solid $color-button; + + font-weight: 700; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + + transition: + background-color 300ms ease, + color 300ms ease; + + &:hover { + background-color: $color-button-hover; + color: $color-button-text-hover; + border: 1px solid $color-button; + } + } +} diff --git a/src/styles/_catalog.scss b/src/styles/_catalog.scss new file mode 100644 index 0000000000..bf5afc9469 --- /dev/null +++ b/src/styles/_catalog.scss @@ -0,0 +1,24 @@ +@use 'variables' as *; + +.catalog { + padding: 50px 40px; +} + +.catalog__grid { + display: grid; + grid-template-columns: repeat(1, $card-width); + gap: 46px 48px; + justify-content: center; + + @media (min-width: 488px) { + grid-template-columns: repeat(2, $card-width); + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, $card-width); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, $card-width); + } +} diff --git a/src/styles/_header.scss b/src/styles/_header.scss new file mode 100644 index 0000000000..7bce1e2bd5 --- /dev/null +++ b/src/styles/_header.scss @@ -0,0 +1,72 @@ +@use 'variables' as *; + +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + box-sizing: border-box; + + &__logo { + display: flex; + align-items: center; + + img { + display: block; + height: 40px; + width: auto; + } + } + + &__nav { + height: 100%; + } + + &__nav-list { + display: flex; + margin: 0; + padding: 0; + list-style: none; + } + + &__nav-item { + margin-right: 20px; + + &:last-child { + margin-right: 0; + } + } + + &__nav-link { + position: relative; + text-transform: uppercase; + display: flex; + align-items: center; + justify-content: center; + height: 60px; + color: $color-text-primary; + text-decoration: none; + font-size: 12px; + line-height: 14px; + transition: color 300ms ease; + + &:hover { + color: $main-color; + } + + &.is-active { + color: $main-color; + + &::after { + content: ''; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + height: 4px; + background-color: $main-color; + border-radius: 8px; + } + } + } +} diff --git a/src/styles/_stars.scss b/src/styles/_stars.scss new file mode 100644 index 0000000000..990462de14 --- /dev/null +++ b/src/styles/_stars.scss @@ -0,0 +1,20 @@ +.stars { + display: flex; + gap: 4px; + + &__star { + display: inline-block; + width: 16px; + height: 16px; + background-image: url('../images/star.svg'); + background-size: 12.5px 12.5px; + background-repeat: no-repeat; + background-position: center; + } + + @for $i from 1 through 5 { + &--#{$i} .stars__star:nth-child(-n + #{$i}) { + background-image: url('../images/star-active.svg'); + } + } +} diff --git a/src/styles/_variables.scss b/src/styles/_variables.scss new file mode 100644 index 0000000000..340e62a0c3 --- /dev/null +++ b/src/styles/_variables.scss @@ -0,0 +1,12 @@ +$main-color: #00acdc; +$card-size: 16px; +$card-width: 200px; +$card-border: 1px solid #f3f3f3; +$card-radius: 5px; +$card-padding: 16px; +$color-text-primary: #060b35; +$color-text-muted: #616070; +$color-button: #00acdc; +$color-button-text: #fff; +$color-button-hover: #fff; +$color-button-text-hover: #00acdc; diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..c6b17301a0 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,6 @@ -body { - margin: 0; -} +@use 'variables' as *; +@use 'base'; +@use 'header'; +@use 'card'; +@use 'stars'; +@use 'catalog';