From 29e55c8fef6a367f6264a3f634c91281616baf71 Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 22 May 2026 02:03:10 +0300 Subject: [PATCH 1/4] task complete --- readme.md | 6 +- src/index.html | 212 +++++++++++++++++++++++++++++++++++++- src/styles/card.scss | 93 +++++++++++++++++ src/styles/header.scss | 60 +++++++++++ src/styles/index.scss | 41 ++++++++ src/styles/mixins.scss | 13 +++ src/styles/stars.scss | 21 ++++ src/styles/variables.scss | 6 ++ 8 files changed, 448 insertions(+), 4 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/mixins.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/variables.scss diff --git a/readme.md b/readme.md index acd5174814..74875cd997 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://NureSviderskyiOleksandr.github.io/layout_catalog/) +- [TEST REPORT LINK](https://NureSviderskyiOleksandr.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..689b9a02bc 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,216 @@ -

Catalog

+ +
+
+
+
+ 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/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..9348ae1fba --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,93 @@ +.card { + position: relative; + display: flex; + flex-direction: column; + box-sizing: border-box; + width: 200px; + border: 1px solid $border-color; + border-radius: 5px; + padding: 16px; + align-items: center; + font-family: $card-font-family; + + &__image { + background-image: url('../images/imac.jpeg'); + background-size: 160px 134px; + background-position: center; + margin-top: 16px; + margin-bottom: 40px; + width: 160px; + height: 134px; + } + + &__title { + font-size: 12px; + line-height: 18px; + font-weight: 500; + margin-bottom: 4px; + color: $main-color; + } + + &__code { + align-self: flex-start; + font-size: 10px; + line-height: 14px; + color: $sub-color; + font-weight: 400; + margin-bottom: 16px; + } + + &__rating { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + } + + &__count { + font-weight: 400; + font-size: 10px; + color: $main-color; + } + + &__price { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + } + + &__price-value { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $main-color; + } + + &__price-label { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: $sub-color; + } + + &__button { + margin-top: 16px; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + width: 166px; + height: 40px; + background-color: $blue-color; + border-radius: 5px; + + font-weight: 700; + font-size: 14px; + line-height: 16px; + color: #fff; + text-transform: uppercase; + text-decoration: none; + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..90715bdd49 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,60 @@ +.menu-container { + display: flex; + height: $header-height; + padding: 0 50px; + color: #060b35; + + justify-content: space-between; + align-items: center; +} + +.nav-list { + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +.logo { + width: 40px; + height: 40px; +} + +.nav-list__nav-link { + display: flex; + position: relative; + align-items: center; + height: $header-height; + text-decoration: none; + color: #000; + font-size: 12px; + margin-right: 20px; +} + +.nav-list__nav-link:hover { + transition: 300ms; + color: $blue-color; +} + +.nav-list__nav-link:focus { + color: $blue-color; +} + +li:last-child .nav-list__nav-link { + margin-right: 0; +} + +.is-active::after { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: $blue-color; + bottom: 0; +} + +.is-active { + color: $blue-color; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..93b77c3308 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,44 @@ +@import './variables'; +@import './mixins'; +@import './header'; +@import './card'; +@import './stars'; + body { margin: 0; + font-family: Roboto, sans-serif; + font-weight: 500; + text-transform: uppercase; } + + +.container { + display: grid; + padding: 40px 50px; + + @include grid-card-scale; + + gap: 48px 46px; +} + +.card{ + transition: 300ms; + + &:hover{ + transform: scale(1.2); + + .card__title { + transition: 300ms; + color: #34568b; + } + + .card__button { + transition: 300ms; + background-color: #fff; + color: $blue-color; + } + } +} + + + diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss new file mode 100644 index 0000000000..fbd3311f9c --- /dev/null +++ b/src/styles/mixins.scss @@ -0,0 +1,13 @@ +@mixin grid-card-scale{ + @media (min-width: 488px){ + grid-template-columns: repeat(2, 200px); + } + + @media (min-width: 768px){ + grid-template-columns: repeat(3, 200px); + } + + @media (min-width: 1024px){ + grid-template-columns: repeat(4, 200px); + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..30cd23b714 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,21 @@ +.stars { + display: flex; + align-items: center; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + margin-right: 4px; + } + + &--1 .stars__star:nth-child(-n + 1), + &--2 .stars__star:nth-child(-n + 2), + &--3 .stars__star:nth-child(-n + 3), + &--4 .stars__star:nth-child(-n + 4), + &--5 .stars__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..767bdbc844 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,6 @@ +$main-color: #060b35; +$sub-color: #616070; +$border-color: #f3f3f3; +$header-height: 60px; +$blue-color: #00acdc; +$card-font-family: Roboto, sans-serif; From c12ac6561514c2338287d30d91ed9be506eba00b Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 22 May 2026 02:07:55 +0300 Subject: [PATCH 2/4] task complete --- src/index.html | 124 +++++++++++++++++++++++++++++++++++++++++ src/styles/index.scss | 8 +-- src/styles/mixins.scss | 10 ++-- 3 files changed, 131 insertions(+), 11 deletions(-) diff --git a/src/index.html b/src/index.html index 689b9a02bc..dc65f213ec 100644 --- a/src/index.html +++ b/src/index.html @@ -232,6 +232,130 @@ 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/index.scss b/src/styles/index.scss index 93b77c3308..90bab60682 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -11,7 +11,6 @@ body { text-transform: uppercase; } - .container { display: grid; padding: 40px 50px; @@ -21,10 +20,10 @@ body { gap: 48px 46px; } -.card{ +.card { transition: 300ms; - &:hover{ + &:hover { transform: scale(1.2); .card__title { @@ -39,6 +38,3 @@ body { } } } - - - diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss index fbd3311f9c..62c428b73d 100644 --- a/src/styles/mixins.scss +++ b/src/styles/mixins.scss @@ -1,13 +1,13 @@ -@mixin grid-card-scale{ - @media (min-width: 488px){ +@mixin grid-card-scale { + @media (min-width: 488px) { grid-template-columns: repeat(2, 200px); } - @media (min-width: 768px){ + @media (min-width: 768px) { grid-template-columns: repeat(3, 200px); } - - @media (min-width: 1024px){ + + @media (min-width: 1024px) { grid-template-columns: repeat(4, 200px); } } From f0bcbb44bc62dc5bfa532a144cd52641d4b940db Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 22 May 2026 02:13:29 +0300 Subject: [PATCH 3/4] task complete --- src/index.html | 12 ------------ src/styles/header.scss | 2 +- src/styles/index.scss | 4 ++-- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/index.html b/src/index.html index dc65f213ec..adfca3f6bc 100644 --- a/src/index.html +++ b/src/index.html @@ -171,7 +171,6 @@
@@ -195,14 +194,12 @@ Buy
@@ -226,14 +223,12 @@ Buy
@@ -257,14 +252,12 @@ Buy
@@ -288,14 +281,12 @@ Buy
@@ -319,14 +310,12 @@ Buy
@@ -350,7 +339,6 @@ Buy diff --git a/src/styles/header.scss b/src/styles/header.scss index 90715bdd49..8c85728f23 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -26,7 +26,7 @@ align-items: center; height: $header-height; text-decoration: none; - color: #000; + color: $main-color; font-size: 12px; margin-right: 20px; } diff --git a/src/styles/index.scss b/src/styles/index.scss index 90bab60682..bbc4316729 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -13,11 +13,11 @@ body { .container { display: grid; - padding: 40px 50px; + padding: 50px 40px; @include grid-card-scale; - gap: 48px 46px; + gap: 46px 48px; } .card { From 7535b5b328542039e1f50ad8a9e8863c2dbeb605 Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 22 May 2026 02:42:20 +0300 Subject: [PATCH 4/4] fix margins --- src/index.html | 30 +++++++----------------------- src/styles/card.scss | 3 +++ src/styles/header.scss | 3 +++ src/styles/index.scss | 5 ++--- src/styles/mixins.scss | 2 ++ 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/index.html b/src/index.html index adfca3f6bc..76fa11174d 100644 --- a/src/index.html +++ b/src/index.html @@ -139,10 +139,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -164,15 +161,12 @@
Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -199,9 +193,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -228,9 +220,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -257,9 +247,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -286,9 +274,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) @@ -315,9 +301,7 @@ Buy
-
+
APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) diff --git a/src/styles/card.scss b/src/styles/card.scss index 9348ae1fba..531d668eac 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -49,6 +49,7 @@ font-weight: 400; font-size: 10px; color: $main-color; + margin: 0; } &__price { @@ -63,6 +64,7 @@ font-size: 16px; line-height: 18px; color: $main-color; + margin: 0; } &__price-label { @@ -70,6 +72,7 @@ font-size: 12px; line-height: 18px; color: $sub-color; + margin: 0; } &__button { diff --git a/src/styles/header.scss b/src/styles/header.scss index 8c85728f23..b9bc893b84 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -3,6 +3,9 @@ height: $header-height; padding: 0 50px; color: #060b35; + box-shadow: 0 2px 4px 0 #0000000d; + + text-transform: uppercase; justify-content: space-between; align-items: center; diff --git a/src/styles/index.scss b/src/styles/index.scss index bbc4316729..99f2d6deef 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -8,16 +8,15 @@ body { margin: 0; font-family: Roboto, sans-serif; font-weight: 500; - text-transform: uppercase; } .container { display: grid; padding: 50px 40px; + gap: 46px 48px; + justify-content: center; @include grid-card-scale; - - gap: 46px 48px; } .card { diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss index 62c428b73d..74b33f3035 100644 --- a/src/styles/mixins.scss +++ b/src/styles/mixins.scss @@ -1,4 +1,6 @@ @mixin grid-card-scale { + grid-template-columns: repeat(1, 200px); + @media (min-width: 488px) { grid-template-columns: repeat(2, 200px); }