From d8db55b2c37a47cb19cc042092a4d81ec7f66dce Mon Sep 17 00:00:00 2001 From: diiyavol Date: Sun, 28 Jun 2026 14:38:46 +0300 Subject: [PATCH 1/4] add task solution --- src/index.html | 323 +++++++++++++++++++++++++++++++++++++- src/styles/header.scss | 98 ++++++++++++ src/styles/index.scss | 183 +++++++++++++++++++++ src/styles/variables.scss | 4 + 4 files changed, 606 insertions(+), 2 deletions(-) create mode 100644 src/styles/header.scss create mode 100644 src/styles/variables.scss diff --git a/src/index.html b/src/index.html index 9cff78eeb7..4239143812 100644 --- a/src/index.html +++ b/src/index.html @@ -20,8 +20,327 @@ href="styles/index.scss" /> - -

Catalog

+
+ + logo + + + +
+
+
+
+
+
+ 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 (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ + buy + +
+
+
+
+
+ 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 (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
+
Price:
+
$2,199
+
+ + buy + +
+
+
+
+
+ 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 (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
+
Price:
+
$2,199
+
+ + buy + +
+
+
+
+
+ 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 (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
+
Price:
+
$2,199
+
+ + buy + +
+
diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..7e91787d47 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,98 @@ +:root { + --text-color: #00acdc; + --nav-link-color: #060b35; +} + +html, +body, +header, +nav, +ul, +li, +a, +img { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: Roboto, sans-serif; + font-optical-sizing: auto; + font-weight: 500; + font-style: normal; +} + +.header { + width: 100vw; + display: flex; + justify-content: space-between; + align-items: center; + border-bottom: #f3f3f3 1px solid; + &__logo-link { + display: inline-block; + } + + &__logo-img { + display: block; + margin: 10px 0 10px 50px; + } + + &__nav { + display: flex; + align-items: center; + height: 60px; + margin-right: 50px; + margin-left: auto; + } +} + +.menu { + &__list { + display: flex; + align-items: center; + height: 100%; + list-style-type: none; + } + + &__item { + height: 100%; + display: flex; + align-items: center; + } + + &__item:not(:first-child) { + margin-left: 20px; + } + + &__link { + text-transform: uppercase; + font-size: 12px; + text-decoration: none; + color: var(--nav-link-color); + display: flex; + align-items: center; + height: 100%; + position: relative; + transition: color 0.2s ease; + } + + &__link:hover { + color: var(--text-color); + } + + &__link.is-active { + color: var(--text-color); + } + + &__link.is-active::after { + content: ''; + width: 100%; + background-color: var(--text-color); + height: 4px; + border-radius: 8px; + position: absolute; + bottom: 0; + left: 0; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..0bbf9fc2df 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,186 @@ +@import './header'; +@import './variables'; + body { margin: 0; } + +main { + box-sizing: border-box; + display: grid; + grid-template-rows: 1fr 1fr 1fr 1fr; + grid-template-columns: repeat(4, $width__card); + justify-content: center; + gap: 46px 48px; + padding: 50px 40px; +} + +@media (min-width: 300px) { + main { + grid-template-columns: repeat(1, $width__card); + } +} + +@media (min-width: 488px) { + main { + grid-template-columns: repeat(2, $width__card); + } +} + +@media (min-width: 768px) { + main { + grid-template-columns: repeat(3, $width__card); + } +} + +@media (min-width: 1024px) { + main { + grid-template-columns: repeat(4, $width__card); + } +} + +.card { + display: flex; + flex-direction: column; + align-items: center; + width: $width__card; + border: #f3f3f3 1px solid; + border-radius: 5px; + box-sizing: border-box; + transition: transform 300ms; + + &__image { + width: 160px; + height: 134px; + background-image: url(../images/imac.jpeg); + background-repeat: no-repeat; + background-size: 100% 100%; + margin-bottom: 40px; + margin-top: 32px; + } + + &__info { + width: 166px; + font-family: Roboto, sans-serif; + font-weight: 500; + font-size: 12px; + line-height: 18px; + } + + &__title { + margin-bottom: 4px; + color: $main-accent; + } + + &:hover &__title { + color: #34568b; + } + + &:hover{ + transform: scale(1.2); + } + &__code { + margin-bottom: 16px; + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $secondary; + } + + &__button { + background-color: $blue-accent; + border-radius: 5px; + width: 166px; + height: 40px; + display: flex; + justify-content: space-evenly; + margin-top: 16px; + margin-bottom: 16px; + + align-items: center; + + color: #fff; + text-decoration: none; + font-family: Roboto, sans-serif; + font-weight: 700; + font-size: 14px; + line-height: 16px; + text-transform: uppercase; + &:hover { + color: $blue-accent; + background-color: #fff; + border: 1px $blue-accent solid; + box-sizing: border-box; + } + } + + &__price { + display: flex; + margin-top: 24px; + justify-content: space-between; + width: 166px; + } + + &__price-label { + color: $secondary; + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 12px; + line-height: 18px; + } + + &__price-value { + margin-left: 85px; + font-family: Roboto, sans-serif; + font-weight: 700; + font-size: 16px; + line-height: 18px; + } +} + +.card__rating { + display: flex; +} + +.rating { + &__stars { + display: flex; + } + &__star { + background-image: url(../images/star.svg); + width: 16px; + height: 16px; + margin-right: 4px; + background-repeat: no-repeat; + background-position: center; + } + + &__reviews { + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 10px; + margin-left: 17px; + align-self: center; + } + + &__stars--1 &__star:nth-child(-n + 1) { + background-image: url('../images/star-active.svg'); + } + + &__stars--2 &__star:nth-child(-n + 2) { + background-image: url('../images/star-active.svg'); + } + + &__stars--3 &__star:nth-child(-n + 3) { + background-image: url('../images/star-active.svg'); + } + + &__stars--4 &__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); + } + + &__stars--5 &__star:nth-child(-n + 5) { + 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..a2bda3690c --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,4 @@ +$main-accent: #060b35; +$secondary: #616070; +$blue-accent: #00acdc; +$width__card: 200px; From 17201baed1987cd01978beacfe1b5ec7f3c9aeda Mon Sep 17 00:00:00 2001 From: diiyavol Date: Sun, 28 Jun 2026 14:45:40 +0300 Subject: [PATCH 2/4] add task solution2 --- src/styles/header.scss | 4 ++-- src/styles/index.scss | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/styles/header.scss b/src/styles/header.scss index 7e91787d47..2d565d2e34 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -28,7 +28,7 @@ body { display: flex; justify-content: space-between; align-items: center; - border-bottom: #f3f3f3 1px solid; + border-bottom: #f3f3f3 1px solid; &__logo-link { display: inline-block; } @@ -74,7 +74,7 @@ body { align-items: center; height: 100%; position: relative; - transition: color 0.2s ease; + transition: color 300ms ease; } &__link:hover { diff --git a/src/styles/index.scss b/src/styles/index.scss index 0bbf9fc2df..62a2b5ee7b 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -76,7 +76,7 @@ main { color: #34568b; } - &:hover{ + &:hover { transform: scale(1.2); } &__code { @@ -112,6 +112,7 @@ main { background-color: #fff; border: 1px $blue-accent solid; box-sizing: border-box; + transition: 300ms; } } From 5752525ca11033889faa82b5775a80fa94dbbffa Mon Sep 17 00:00:00 2001 From: diiyavol Date: Sun, 28 Jun 2026 14:56:42 +0300 Subject: [PATCH 3/4] add task solution3 --- src/styles/header.scss | 1 + src/styles/index.scss | 13 ++++++++----- src/styles/variables.scss | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/styles/header.scss b/src/styles/header.scss index 2d565d2e34..e806210cbf 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -78,6 +78,7 @@ body { } &__link:hover { + transition: color 300ms ease; color: var(--text-color); } diff --git a/src/styles/index.scss b/src/styles/index.scss index 62a2b5ee7b..fdf4b27243 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -44,7 +44,7 @@ main { flex-direction: column; align-items: center; width: $width__card; - border: #f3f3f3 1px solid; + border: $border-card 1px solid; border-radius: 5px; box-sizing: border-box; transition: transform 300ms; @@ -73,7 +73,8 @@ main { } &:hover &__title { - color: #34568b; + transition: color 300ms ease; + color: $title-hovered; } &:hover { @@ -100,19 +101,21 @@ main { align-items: center; - color: #fff; + color: $color-button; text-decoration: none; font-family: Roboto, sans-serif; font-weight: 700; font-size: 14px; line-height: 16px; text-transform: uppercase; + + transition: color 300ms, background-color 300ms, border-color 300ms; + &:hover { color: $blue-accent; - background-color: #fff; + background-color: $color-button; border: 1px $blue-accent solid; box-sizing: border-box; - transition: 300ms; } } diff --git a/src/styles/variables.scss b/src/styles/variables.scss index a2bda3690c..d8a0807d4c 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -2,3 +2,6 @@ $main-accent: #060b35; $secondary: #616070; $blue-accent: #00acdc; $width__card: 200px; +$title-hovered: #34568b; +$color-button: #fff; +$border-card: #f3f3f3; From d37fa96eaf98d862197e852ab478de4334e9bed5 Mon Sep 17 00:00:00 2001 From: diiyavol Date: Sun, 28 Jun 2026 15:04:10 +0300 Subject: [PATCH 4/4] add task solution4 --- src/styles/header.scss | 4 +++- src/styles/index.scss | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/styles/header.scss b/src/styles/header.scss index e806210cbf..98c149cca3 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -1,3 +1,5 @@ +@import './variables'; + :root { --text-color: #00acdc; --nav-link-color: #060b35; @@ -28,7 +30,7 @@ body { display: flex; justify-content: space-between; align-items: center; - border-bottom: #f3f3f3 1px solid; + &__logo-link { display: inline-block; } diff --git a/src/styles/index.scss b/src/styles/index.scss index fdf4b27243..77c948bd8e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -109,7 +109,10 @@ main { line-height: 16px; text-transform: uppercase; - transition: color 300ms, background-color 300ms, border-color 300ms; + transition: + color 300ms, + background-color 300ms, + border-color 300ms; &:hover { color: $blue-accent;