diff --git a/readme.md b/readme.md index acd5174814..3d5a57f934 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://ggylyon.github.io/layout_catalog/) +- [TEST REPORT LINK](https://ggylyon.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..74987638dc 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,338 @@ -

Catalog

+
+ + Moyo + + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ Buy +
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock +
+
+

+ 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..c175827a63 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,111 @@ +@import 'stars'; + +.card { + width: $card-width; + box-sizing: border-box; + border: 1px solid $white-color; + border-radius: 5px; + + display: flex; + flex-direction: column; + align-items: center; + padding: 32px 16px 16px; + + @include transition-time; + + &__title { + &-name { + font-weight: 500; + font-size: 12px; + + @include transition-time; + } + + &-code { + font-weight: 400; + font-size: 10px; + color: $secondary-color; + margin-top: 4px; + line-height: 14px; + } + } + + &__image { + display: block; + width: 160px; + height: 134px; + } + + &__content { + margin-top: 40px; + } + + &__rating { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 16px; + } + + &__reviews { + display: block; + font-weight: 400; + font-size: 10px; + line-height: 100%; + margin: 0; + } + + &__info { + display: flex; + justify-content: space-between; + align-items: center; + color: $secondary-color; + font-weight: 400; + font-size: 12px; + margin-top: 24px; + } + + &__price { + color: $main-color; + font-weight: 700; + font-size: 16px; + } + + &__buy-button { + margin-top: 16px; + } + + &:hover { + transform: scale(1.2); + + .card__title-name { + color: $cyan-color; + } + } +} + +.buy-button { + display: flex; + justify-content: center; + align-items: center; + + box-sizing: border-box; + width: 100%; + height: 40px; + + background-color: $blue-color; + border: 1px solid $blue-color; + border-radius: 5px; + + color: #fff; + text-transform: uppercase; + font-weight: 700; + font-size: 14px; + + @include transition-time; + + &:hover { + background: #fff; + color: $blue-color; + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..1f95d3f6f3 --- /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; + box-shadow: 0 2px 4px 0 #0000000d; + + &__logo-image { + display: block; + } + + &__menu { + &-list { + display: flex; + align-items: center; + padding: 0; + list-style: none; + } + + &-item { + text-transform: uppercase; + margin: 0 10px; + + &:first-child { + margin-left: 0; + } + &:last-child { + margin-right: 0; + } + } + + &-link { + height: 60px; + line-height: 60px; + display: inline-block; + text-decoration: none; + color: $main-color; + + @include transition-time; + + &:hover { + color: $blue-color; + } + } + } +} + +.is-active { + color: $blue-color; + position: relative; + + &::after { + content: ''; + + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 4px; + background: $blue-color; + border-radius: 8px; + } +} diff --git a/src/styles/blocks/main.scss b/src/styles/blocks/main.scss new file mode 100644 index 0000000000..799c2d9287 --- /dev/null +++ b/src/styles/blocks/main.scss @@ -0,0 +1,29 @@ +@import '../blocks/card'; + +.main { + display: flex; + justify-content: center; + align-items: center; + padding: 50px 40px; + &__cards { + display: grid; + gap: 46px; + column-gap: 48px; + + @include small-smartphones { + grid-template-columns: repeat(1, $card-width); + } + + @include smartphones { + grid-template-columns: repeat(2, $card-width); + } + + @include tablets { + grid-template-columns: repeat(3, $card-width); + } + + @include computers { + grid-template-columns: repeat(4, $card-width); + } + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..93d7a943d1 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,27 @@ +.stars { + height: 16px; + display: flex; + + &__star { + width: 16px; + margin-inline: 2px; + + background-image: $star-inactive-image; + background-position: center; + background-repeat: no-repeat; + + &:first-child { + margin-left: 0; + } + + &:last-child { + margin-right: 0; + } + } + + @for $rating from 0 through 5 { + &--#{$rating} &__star:nth-child(-n + #{$rating}) { + background-image: $star-active-image; + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..72ef0c89b8 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,24 @@ -body { +@import 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap'; +@import 'utils/variables'; +@import 'utils/mixins'; +@import 'blocks/header'; +@import 'blocks/main'; + +body, +html, +header, +div, +nav, +ul, +p { margin: 0; + padding: 0; +} + +body { + font-family: Roboto, sans-serif; + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $main-color; } diff --git a/src/styles/utils/mixins.scss b/src/styles/utils/mixins.scss new file mode 100644 index 0000000000..6b0053b404 --- /dev/null +++ b/src/styles/utils/mixins.scss @@ -0,0 +1,27 @@ +@mixin transition-time { + transition: all 0.3s; +} + +@mixin small-smartphones { + @media (max-width: 487px) { + @content; + } +} + +@mixin smartphones { + @media (min-width: 488px) { + @content; + } +} + +@mixin tablets { + @media (min-width: 768px) { + @content; + } +} + +@mixin computers { + @media (min-width: 1024px) { + @content; + } +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..588f1531ef --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,8 @@ +$blue-color: #00acdc; +$star-inactive-image: url('../images/star.svg'); +$star-active-image: url(../images/star-active.svg); +$main-color: #060b35; +$secondary-color: #616070; +$white-color: #f3f3f3; +$cyan-color: #34568b; +$card-width: 200px;