From 840abd9dd2d43fa0ff0882dc3ee53d4e27337100 Mon Sep 17 00:00:00 2001 From: Maksym Sheremeta Date: Sun, 28 Jun 2026 17:22:30 +0300 Subject: [PATCH 1/3] add solution --- src/index.html | 396 ++++++++++++++++++++++++++++- src/styles/card.scss | 99 ++++++++ src/styles/content.scss | 20 ++ src/styles/header.scss | 14 + src/styles/index.scss | 17 ++ src/styles/nav.scss | 55 ++++ src/styles/stars.scss | 28 ++ src/styles/utilites/mixins.scss | 25 ++ src/styles/utilites/variables.scss | 11 + 9 files changed, 664 insertions(+), 1 deletion(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/content.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/nav.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/utilites/mixins.scss create mode 100644 src/styles/utilites/variables.scss diff --git a/src/index.html b/src/index.html index 9cff78eeb7..c463e1b241 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,400 @@ -

Catalog

+
+ + + +
+ +
+
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+ +
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
+ image + +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+ +
Product code: 195434
+ +
+
+
+ + + + + +
+
+
Reviews: 5
+
+ +
+
Price:
+
$2,199
+
+ + + Buy + +
+
diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..1e35465bdf --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,99 @@ +.card { + box-sizing: border-box; + width: $card-width; + display: flex; + flex-direction: column; + align-items: center; + + border: 1px solid #f3f3f3; + border-radius: 5px; + + padding: 32px 16px 16px; + + transition: 300ms; + + &__image { + height: 134px; + width: 160px; + + margin: 0 auto; + } + + &__title { + margin-top: 40px; + + font-weight: 500; + font-size: 12px; + line-height: 18px; + + color: $text-main-color; + } + + &__product-code { + margin-top: 4px; + + @include width-with-spacing; + + font-size: 10px; + color: $text-secondary-color; + } + + &__rate { + margin-top: 16px; + + @include width-with-spacing; + + align-items: flex-end; + font-size: 10px; + } + + &__price { + margin-top: 24px; + font-size: 16px; + line-height: 18px; + + @include width-with-spacing; + + &-title { + color: $text-secondary-color; + font-size: 12px; + } + + &-amount { + font-weight: 700; + font-size: 16px; + } + } + + &__button_buy { + margin-top: 16px; + + @include width-with-spacing; + + justify-content: center; + background-color: $accent-color; + border: none; + border-radius: 5px; + height: 40px; + font-size: 14px; + text-transform: uppercase; + color: #fff; + font-weight: 700; + text-decoration: none; + + &:hover { + background-color: #fff; + border: 1px solid $accent-color; + color: $accent-color; + font-weight: 700; + } + } + + &:hover { + transform: scale(1.2); + + .card__title { + color: #34568b; + } + } +} diff --git a/src/styles/content.scss b/src/styles/content.scss new file mode 100644 index 0000000000..ce4381a7b2 --- /dev/null +++ b/src/styles/content.scss @@ -0,0 +1,20 @@ +.content { + box-sizing: border-box; + padding: $container-vertical-padding $container-horizontal-padding; + display: grid; + grid-template-columns: repeat(1, $card-width); + justify-content: center; + gap: $container-vertical-gap $container-horizontal-gap; + + @include on-small-screen { + grid-template-columns: repeat(2, $card-width); + } + + @include on-medium-screen { + grid-template-columns: repeat(3, $card-width); + } + + @include on-large-screen { + 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..06f74ad44b --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,14 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + background-color: #fff; + padding: 0 50px; + box-shadow: 0 2px 4px 0 #0000000d; + + &__logo { + display: flex; + height: 40px; + width: 40px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..1d6b5ff235 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,20 @@ +@import '../styles/utilites/variables'; +@import '../styles/utilites/mixins'; +@import './content'; +@import './card'; +@import './stars'; +@import './header'; +@import './nav'; + +html { + font-family: Roboto, sans-serif; + font-style: normal; + font-weight: 400; + line-height: 14px; + + color: $text-main-color; +} + body { margin: 0; } diff --git a/src/styles/nav.scss b/src/styles/nav.scss new file mode 100644 index 0000000000..9e5de627eb --- /dev/null +++ b/src/styles/nav.scss @@ -0,0 +1,55 @@ +.nav { + &__list { + display: flex; + align-items: center; + margin: 0; + padding: 0; + list-style: none; + } + + &__item { + margin-left: 20px; + } + + &__list :first-child { + margin-left: 0; + } + + &__link { + position: relative; + + display: flex; + align-items: center; + + padding: 0; + height: 60px; + color: $text-main-color; + + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; + white-space: nowrap; + text-decoration: none; + text-transform: uppercase; + } + + &__link:hover { + color: $accent-color; + } + + &__link.is-active { + color: $accent-color; + } + + &__link.is-active::after { + content: ''; + position: absolute; + bottom: 0; + right: 0; + left: 0; + + height: 4px; + background-color: $accent-color; + border-radius: 8px; + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..876b627e71 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,28 @@ +.stars { + display: flex; + + &__star { + box-sizing: border-box; + display: flex; + background-image: url('../images/star.svg'); + + background-repeat: no-repeat; + background-position: center; + + width: 16px; + height: 16px; + margin-right: 4px; + } + + &__star:last-child { + margin-right: 0; + } +} + +.stars--1 .stars__star:nth-of-type(-n + 1), +.stars--2 .stars__star:nth-of-type(-n + 2), +.stars--3 .stars__star:nth-of-type(-n + 3), +.stars--4 .stars__star:nth-of-type(-n + 4), +.stars--5 .stars__star:nth-of-type(-n + 5) { + background-image: url('../images/star-active.svg'); +} diff --git a/src/styles/utilites/mixins.scss b/src/styles/utilites/mixins.scss new file mode 100644 index 0000000000..1c5ddf8a75 --- /dev/null +++ b/src/styles/utilites/mixins.scss @@ -0,0 +1,25 @@ +@mixin width-with-spacing() { + width: 100%; + + display: flex; + align-items: center; + justify-content: space-between; +} + +@mixin on-small-screen() { + @media (min-width: $width-small) { + @content; + } +} + +@mixin on-medium-screen() { + @media (min-width: $width-medium) { + @content; + } +} + +@mixin on-large-screen() { + @media (min-width: $width-large) { + @content; + } +} diff --git a/src/styles/utilites/variables.scss b/src/styles/utilites/variables.scss new file mode 100644 index 0000000000..a25c488f77 --- /dev/null +++ b/src/styles/utilites/variables.scss @@ -0,0 +1,11 @@ +$text-main-color: #060b35; +$text-secondary-color: #616070; +$accent-color: #00acdc; +$card-width: 200px; +$container-vertical-padding: 50px; +$container-horizontal-padding: 40px; +$container-vertical-gap: 46px; +$container-horizontal-gap: 48px; +$width-small: 488px; +$width-medium: 768px; +$width-large: 1024px; From b3ba564be77714ca2db4ccb821d61a62fe5c59e9 Mon Sep 17 00:00:00 2001 From: Maksym Sheremeta Date: Sun, 28 Jun 2026 17:33:14 +0300 Subject: [PATCH 2/3] fix problems --- src/styles/card.scss | 4 +++- src/styles/nav.scss | 2 ++ src/styles/utilites/mixins.scss | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/styles/card.scss b/src/styles/card.scss index 1e35465bdf..16e706d7b2 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -10,7 +10,7 @@ padding: 32px 16px 16px; - transition: 300ms; + @include smooth-hover; &__image { height: 134px; @@ -68,9 +68,11 @@ &__button_buy { margin-top: 16px; + @include smooth-hover; @include width-with-spacing; justify-content: center; + box-sizing: border-box; background-color: $accent-color; border: none; border-radius: 5px; diff --git a/src/styles/nav.scss b/src/styles/nav.scss index 9e5de627eb..16835e1898 100644 --- a/src/styles/nav.scss +++ b/src/styles/nav.scss @@ -1,4 +1,6 @@ .nav { + @include smooth-hover; + &__list { display: flex; align-items: center; diff --git a/src/styles/utilites/mixins.scss b/src/styles/utilites/mixins.scss index 1c5ddf8a75..8c0c6c8347 100644 --- a/src/styles/utilites/mixins.scss +++ b/src/styles/utilites/mixins.scss @@ -23,3 +23,7 @@ @content; } } + +@mixin smooth-hover { + transition: 300ms; +} From 89d844d2224c710631d20a6426df01144a452735 Mon Sep 17 00:00:00 2001 From: Maksym Sheremeta Date: Sun, 28 Jun 2026 17:44:21 +0300 Subject: [PATCH 3/3] fix problems --- src/styles/nav.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/styles/nav.scss b/src/styles/nav.scss index 16835e1898..622e71ad78 100644 --- a/src/styles/nav.scss +++ b/src/styles/nav.scss @@ -1,6 +1,4 @@ .nav { - @include smooth-hover; - &__list { display: flex; align-items: center; @@ -18,6 +16,8 @@ } &__link { + @include smooth-hover; + position: relative; display: flex;