From d59638a7ab5f5ea794337fe8ae169a436b6186e6 Mon Sep 17 00:00:00 2001 From: lubov Date: Thu, 2 Jul 2026 16:18:53 +0200 Subject: [PATCH 1/3] add solution --- src/index.html | 317 +++++++++++++++++++++++++++++++++++++++- src/styles/card.scss | 108 ++++++++++++++ src/styles/catalog.scss | 7 + src/styles/header.scss | 12 ++ src/styles/index.scss | 11 ++ src/styles/nav.scss | 47 ++++++ src/styles/stars.scss | 33 +++++ 7 files changed, 533 insertions(+), 2 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/catalog.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/nav.scss create mode 100644 src/styles/stars.scss diff --git a/src/index.html b/src/index.html index 9cff78eeb7..bb867c7778 100644 --- a/src/index.html +++ b/src/index.html @@ -20,8 +20,321 @@ href="styles/index.scss" /> - -

Catalog

+
+ + + + +
+
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ imac +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..b3b1733792 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,108 @@ +.card { + width: 200px; + height: 408px; + border: 1px solid #f3f3f3; + border-radius: 5px; + box-sizing: border-box; + transition-duration: 300ms; + + &:hover { + transform: scale(1.2); + } + + &__image-wrappen { + display: flex; + justify-content: center; + align-items: center; + margin: 32px 19px 40px; + width: 160px; + height: 134px; + } + + &__image { + object-fit: contain; + max-width: 100%; + } + + &__name { + margin: 0 16px 4px; + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $main-color; + } + + &:hover &__name { + color: #34568b; + } + + &__code { + margin: 0 0 16px 16px; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: #616070; + } + + &__rating { + display: flex; + justify-content: space-between; + margin: 0 16px 24px; + width: 166px; + height: 16px; + } + + &__reviews { + font-weight: 400; + font-size: 10px; + line-height: 16px; + color: $main-color; + } + + &__price { + display: flex; + justify-content: space-between; + margin: 0 16px 16px; + width: 166px; + height: 18px; + } + + &__price-text { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: #616070; + align-items: bottom; + } + + &__price-number { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $main-color; + justify-content: right; + align-items: bottom; + } + + &__button { + margin-left: 16px; + width: 166px; + height: 40px; + box-sizing: border-box; + border: 1px solid #00acdc; + border-radius: 5px; + background-color: #00acdc; + color: #fff; + text-transform: uppercase; + font-family: Roboto, sans-serif; + font-weight: 700; + font-size: 14px; + line-height: 16px; + transition-duration: 300ms; + + &:hover { + background-color: #fff; + color: #00acdc; + } + } +} diff --git a/src/styles/catalog.scss b/src/styles/catalog.scss new file mode 100644 index 0000000000..a17f706407 --- /dev/null +++ b/src/styles/catalog.scss @@ -0,0 +1,7 @@ +.main { + display: grid; + grid-template-columns: repeat(auto-fit, 200px); + gap: 46px 48px; + padding: 50px 40px; + justify-content: center; +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..f077eec523 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,12 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + height: $header-height; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); + padding: 0 50px; + + &__logo-link { + display: flex; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..c4dd72bcad 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,14 @@ +$header-height: 60px; +$main-color: #060b35; + body { + font-family: Roboto, sans-serif; margin: 0; + scroll-behavior: smooth; } + +@import './header'; +@import './nav'; +@import './catalog'; +@import './card'; +@import './stars'; diff --git a/src/styles/nav.scss b/src/styles/nav.scss new file mode 100644 index 0000000000..41e5a886c1 --- /dev/null +++ b/src/styles/nav.scss @@ -0,0 +1,47 @@ +.nav { + &__list { + display: flex; + padding: 0; + margin: 0; + gap: 20px; + list-style: none; + } + &__item { + display: flex; + padding: 0; + } + + &__link { + display: flex; + align-items: center; + text-decoration: none; + color: $main-color; + text-transform: uppercase; + font-size: 12px; + font-weight: 500; + line-height: 100%; + height: $header-height; + padding: 0; + transition: all 300ms; + + &:hover { + color: #00acdc; + } + } +} + +.is-active { + position: relative; + color: #00acdc; + + &::after { + position: absolute; + display: block; + content: ''; + height: 4px; + width: 100%; + background-color: #00acdc; + border-radius: 8px; + bottom: 0; + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..ba70eab1db --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,33 @@ +.stars { + display: flex; + flex-direction: row; + gap: 4px; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + height: 16px; + width: 16px; + + &--1 &:nth-child(-n + 1) { + background-image: url(../images/star-active.svg); + } + + &--2 &:nth-child(-n + 2) { + background-image: url(../images/star-active.svg); + } + + &--3 &:nth-child(-n + 3) { + background-image: url(../images/star-active.svg); + } + + &--4 &:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } + + &--5 &:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); + } + } +} From 260e915973747791179ee57a060d3977a5916029 Mon Sep 17 00:00:00 2001 From: lubov Date: Thu, 2 Jul 2026 16:51:30 +0200 Subject: [PATCH 2/3] add solution --- src/index.html | 32 ++++++++++++++++---------------- src/styles/card.scss | 8 ++++---- src/styles/catalog.scss | 14 +++++++++++++- src/styles/nav.scss | 2 +- src/styles/stars.scss | 30 +++++++++++++++--------------- 5 files changed, 49 insertions(+), 37 deletions(-) diff --git a/src/index.html b/src/index.html index bb867c7778..fcebb19002 100644 --- a/src/index.html +++ b/src/index.html @@ -114,12 +114,12 @@ alt="imac" /> -
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -147,12 +147,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -175,12 +175,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -203,12 +203,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -231,12 +231,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -259,12 +259,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -287,12 +287,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
@@ -315,12 +315,12 @@ alt="imac" />
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A)
Product code: 195434
-
+
diff --git a/src/styles/card.scss b/src/styles/card.scss index b3b1733792..ae8a1fcf01 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -4,7 +4,7 @@ border: 1px solid #f3f3f3; border-radius: 5px; box-sizing: border-box; - transition-duration: 300ms; + transition: all 300ms; &:hover { transform: scale(1.2); @@ -24,7 +24,7 @@ max-width: 100%; } - &__name { + &__title { margin: 0 16px 4px; font-weight: 500; font-size: 12px; @@ -32,7 +32,7 @@ color: $main-color; } - &:hover &__name { + &:hover &__title { color: #34568b; } @@ -98,7 +98,7 @@ font-weight: 700; font-size: 14px; line-height: 16px; - transition-duration: 300ms; + transition: all 300ms; &:hover { background-color: #fff; diff --git a/src/styles/catalog.scss b/src/styles/catalog.scss index a17f706407..946659126f 100644 --- a/src/styles/catalog.scss +++ b/src/styles/catalog.scss @@ -1,7 +1,19 @@ .main { display: grid; - grid-template-columns: repeat(auto-fit, 200px); + grid-template-columns: 200px; gap: 46px 48px; padding: 50px 40px; justify-content: center; + + @media (min-width: 488px) { + grid-template-columns: 200px 200px; + } + + @media (min-width: 768px) { + grid-template-columns: 200px 200px 200px; + } + + @media (min-width: 1024px) { + grid-template-columns: 200px 200px 200px 200px; + } } diff --git a/src/styles/nav.scss b/src/styles/nav.scss index 41e5a886c1..5fb5192ea2 100644 --- a/src/styles/nav.scss +++ b/src/styles/nav.scss @@ -22,7 +22,7 @@ line-height: 100%; height: $header-height; padding: 0; - transition: all 300ms; + transition: color 300ms; &:hover { color: #00acdc; diff --git a/src/styles/stars.scss b/src/styles/stars.scss index ba70eab1db..6425d57a43 100644 --- a/src/styles/stars.scss +++ b/src/styles/stars.scss @@ -9,25 +9,25 @@ background-position: center; height: 16px; width: 16px; + } - &--1 &:nth-child(-n + 1) { - background-image: url(../images/star-active.svg); - } + &--1 &:nth-child(-n + 1) { + background-image: url(../images/star-active.svg); + } - &--2 &:nth-child(-n + 2) { - background-image: url(../images/star-active.svg); - } + &--2 &:nth-child(-n + 2) { + background-image: url(../images/star-active.svg); + } - &--3 &:nth-child(-n + 3) { - background-image: url(../images/star-active.svg); - } + &--3 &:nth-child(-n + 3) { + background-image: url(../images/star-active.svg); + } - &--4 &:nth-child(-n + 4) { - background-image: url(../images/star-active.svg); - } + &--4 &:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } - &--5 &:nth-child(-n + 5) { - background-image: url(../images/star-active.svg); - } + &--5 &:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); } } From cbc555ba55e855de46f6c4e63ac48f5a7f39d1ea Mon Sep 17 00:00:00 2001 From: lubov Date: Thu, 2 Jul 2026 17:09:11 +0200 Subject: [PATCH 3/3] add solution --- src/styles/stars.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/styles/stars.scss b/src/styles/stars.scss index 6425d57a43..c7c6a9610f 100644 --- a/src/styles/stars.scss +++ b/src/styles/stars.scss @@ -11,23 +11,23 @@ width: 16px; } - &--1 &:nth-child(-n + 1) { + &--1 &__star:nth-child(-n + 1) { background-image: url(../images/star-active.svg); } - &--2 &:nth-child(-n + 2) { + &--2 &__star:nth-child(-n + 2) { background-image: url(../images/star-active.svg); } - &--3 &:nth-child(-n + 3) { + &--3 &__star:nth-child(-n + 3) { background-image: url(../images/star-active.svg); } - &--4 &:nth-child(-n + 4) { + &--4 &__star:nth-child(-n + 4) { background-image: url(../images/star-active.svg); } - &--5 &:nth-child(-n + 5) { + &--5 &__star:nth-child(-n + 5) { background-image: url(../images/star-active.svg); } }