diff --git a/readme.md b/readme.md index acd5174814..7a2bf4cd9e 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://Natalia-Onufrienko.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Natalia-Onufrienko.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..a8166b6b81 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,412 @@ -

Catalog

+
+ + + +
+ +
+
+
+ card__image +
+ +

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

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

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

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

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

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

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

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

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

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

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

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

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

+ +
Product code: 195434
+ +
+
+
+
+
+
+
+
+ +
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+ +
+
+ card__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/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..3b08980f7f --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,111 @@ +@import '../variables'; + +.card { + width: $card-width; + padding: $card-padding; + border: 1px solid $color-border; + border-radius: $radius-small; + box-sizing: border-box; + display: flex; + flex-direction: column; + transition: transform 300ms; + + &__title { + font-size: $font-size-base; + font-weight: $fw-medium; + line-height: 18px; + margin: 0 0 $gap-xs; + transition: color $transition-duration $transition-ease; + } + + &:hover { + transform: scale($hover-scale); + z-index: 1; + + .card__title { + color: $color-hover-title; + } + } + + &__rating { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-lg; + } + + &__reviews { + display: flex; + align-items: center; + font-weight: $fw-regular; + font-size: $font-size-small; + line-height: $line-height-sm; + } + + &__image { + width: 160px; + height: 134px; + margin: 0 auto 40px; + display: flex; + justify-content: center; + align-items: center; + + img { + width: 100%; + height: 100%; + object-fit: contain; + } + } + + &__code { + font-size: $font-size-small; + font-weight: $fw-regular; + line-height: $line-height-sm; + color: $color-text-gray; + margin-bottom: $space-md; + } + + &__money { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: $space-md; + } + + &__price { + font-weight: $fw-regular; + font-size: 12px; + line-height: $line-height-base; + color: $color-text-gray; + } + + &__currency { + font-weight: $fw-bold; + font-size: 16px; + line-height: $line-height-base; + color: $color-text-dark; + } + + &__buy { + display: inline-block; + width: 166px; + height: $btn-height; + line-height: $btn-height; + text-align: center; + background-color: $color-primary; + border-radius: $radius-small; + text-decoration: none; + color: $color-white; + font-size: $font-size-medium; + font-weight: $fw-bold; + font-family: $font-family; + transition: all $transition-duration $transition-ease; + border: 1px solid transparent; + + &:hover { + background-color: $color-white; + color: $color-primary; + border-color: $color-primary; + } + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..7d8d7bc6a8 --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,64 @@ +@import '../variables'; + +.header { + background-color: $color-bg-header; + display: flex; + align-items: center; + justify-content: space-between; + padding: $nav-padding; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); + font-size: 12px; + font-weight: $fw-medium; +} + +.logo { + &__img { + height: 40px; + width: 40px; + display: block; + } +} + +.nav { + &__list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + } + + &__item { + &:not(:last-child) { + margin-right: $nav-gap; + } + } + + &__link { + text-transform: uppercase; + height: $nav-height; + position: relative; + color: $color-link; + text-decoration: none; + display: flex; + align-items: center; + justify-content: center; + transition: color $transition-duration $transition-ease; + + &:hover, + &.is-active { + color: $color-primary; + } + + &.is-active::after { + background-color: $color-primary; + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 4px; + border-radius: 4px; + width: 100%; + } + } +} diff --git a/src/styles/blocks/page.scss b/src/styles/blocks/page.scss new file mode 100644 index 0000000000..4fdf30fb6b --- /dev/null +++ b/src/styles/blocks/page.scss @@ -0,0 +1,20 @@ +html { + box-sizing: border-box; +} + +* { + box-sizing: border-box; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +body { + margin: 0; + padding: 0; + font-family: $font-family; + color: $color; +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..07bd26e215 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,24 @@ +@import '../variables'; + +.stars { + display: flex; + align-items: center; + gap: $gap-xs; + + &__item { + background-image: url('../images/star.svg'); + width: $star-size; + height: $star-size; + background-position: 50%; + background-repeat: no-repeat; + display: block; + } + + &--1 &__item:nth-child(-n + 1), + &--2 &__item:nth-child(-n + 2), + &--3 &__item:nth-child(-n + 3), + &--4 &__item:nth-child(-n + 4), + &--5 &__item: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..64d05ea91e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,6 @@ -body { - margin: 0; -} +@import './variables'; +@import '../styles/blocks/page'; +@import '../styles/blocks/header'; +@import '../styles/blocks/card'; +@import '../styles/blocks/stars'; +@import './layout'; diff --git a/src/styles/layout.scss b/src/styles/layout.scss new file mode 100644 index 0000000000..aa34472107 --- /dev/null +++ b/src/styles/layout.scss @@ -0,0 +1,20 @@ +.main { + width: 100%; + display: grid; + gap: 46px 48px; + padding: 50px 40px; + justify-content: center; + grid-template-columns: repeat(1, $card-width); + + @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/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..e4dfbf0b10 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,39 @@ +$font-family: 'Roboto', sans-serif; +$fw-regular: 400; // для всього тексту +$fw-medium: 500; // заголовки, назви головні +$fw-bold: 700; // для кнопок + +$line-height-base: 18px; // проміжок між картками +$line-height-sm: 14px; // проміжок для відступів + +$color: #060b35; // хедер +$color-primary: #00acdc; // колір кнопок +$color-primary-hover: #00a3d1; // колір активних карток +$color-border: #f3f3f3; // колір меж карток +$color-text-gray: #616070; // колір коду +$color-text-dark: #060d35; // колір для цін +$color-white: #fff; // колір для фона кнопок + +$radius-small: 5px; // маленикий радіус округлення для кнопок +$space-md: 16px; // для марджин боттом між елементами +$space-lg: 24px; // великий відступ між блоками +$gap-xs: 4px; // маленький проміжок між елементами +// $gap-lay: 48px 46px; +$padding: 50px 40px; +$star-size: 16px; // розмір однієї зірки +$btn-height: 40px; // висота кнопки +$card-width: 200px; +$card-height: 408px; +$card-padding: 32px 16px 16px; +$transition-duration: 300ms; +$transition-ease: ease; +$hover-scale: 1.2; +$color-hover-title: #34568b; +$font-size-base: 12px; +$font-size-small: 10px; +$font-size-medium: 14px; +$color-bg-header: #fff; +$color-link: #060b35; +$nav-height: 60px; +$nav-padding: 0 50px; +$nav-gap: 20px;