From af4ea136b7d415cee3b26e91e16579895a526d44 Mon Sep 17 00:00:00 2001 From: Abdalla Tayyah Date: Wed, 3 Jun 2026 20:20:25 +0300 Subject: [PATCH 1/5] feat: load solution --- src/index.html | 422 +++++++++++++++++++++++++++++++++++++++- src/styles/card.scss | 156 +++++++++++++++ src/styles/catalog.scss | 21 ++ src/styles/header.scss | 77 ++++++++ src/styles/index.scss | 3 - src/styles/stars.scss | 22 +++ 6 files changed, 696 insertions(+), 5 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/catalog.scss create mode 100644 src/styles/header.scss delete mode 100644 src/styles/index.scss create mode 100644 src/styles/stars.scss diff --git a/src/index.html b/src/index.html index 9cff78eeb7..33cb150f20 100644 --- a/src/index.html +++ b/src/index.html @@ -17,11 +17,429 @@ /> + + -

Catalog

+
+ + +
+ +
+
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ imac + +

+ 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..2e43473a2d --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,156 @@ +@import './stars'; + +body { + font-family: Roboto, sans-serif; +} + +* { + margin: 0; + box-sizing: border-box; +} + +.card { + position: relative; + display: flex; + flex-direction: column; + width: 200px; + height: 408px; + background-color: #fff; + border-radius: 5px; + border: 1px solid #f3f3f3; + + transition: + transform 300ms ease, + box-shadow 300ms ease; + z-index: 1; + + &__image { + position: absolute; + width: 160px; + height: 134px; + top: 33px; + left: 20px; + } + + &__title { + color: #060b35; + position: absolute; + font-weight: 500; + font-size: 12px; + line-height: 18px; + + width: 166px; + height: 36px; + top: 207px; + left: 17px; + + transition: color 300ms ease; + + .card__title { + color: #34568b; + } + } + + &__code { + position: absolute; + color: #616070; + font-weight: 400; + font-size: 10px; + line-height: 14px; + + width: 98px; + height: 14px; + top: 247px; + left: 17px; + } + + &__price { + position: absolute; + top: 317px; + left: 17px; + width: 166px; + + display: flex; + align-items: center; + justify-content: space-between; + + &-label { + color: #616070; + font-weight: 400; + font-size: 12px; + line-height: 18px; + margin: 0; + } + + &-value { + color: #060b35; + font-weight: 700; + font-size: 16px; + line-height: 18px; + margin: 0; + } + } + + &__rating { + position: absolute; + width: 166px; + height: 16px; + top: 277px; + left: 17px; + + display: flex; + align-items: center; + justify-content: space-between; + + &-reviews { + color: #060b35; + font-weight: 400; + font-size: 10px; + line-height: 14px; + margin: 0; + } + } + + &__button { + position: absolute; + width: 166px; + height: 40px; + top: 351px; + left: 17px; + border-radius: 5px; + background-color: #00acdc; + + box-sizing: border-box; + + display: flex; + align-items: center; + justify-content: center; + + color: #fff; + text-decoration: none; + font-weight: 700; + font-size: 14px; + line-height: 16px; + text-align: center; + text-transform: uppercase; + + border: 1px solid transparent; + + transition: + background-color 300ms ease, + color 300ms ease, + border-color 300ms ease; + + &:hover { + background-color: #fff; + border-color: #00acdc; + color: #00acdc; + } + } + + &:hover { + transform: scale(1.2); + z-index: 10; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); + } +} diff --git a/src/styles/catalog.scss b/src/styles/catalog.scss new file mode 100644 index 0000000000..741487acce --- /dev/null +++ b/src/styles/catalog.scss @@ -0,0 +1,21 @@ +.catalog { + display: grid; + padding: 50px 40px; + gap: 46px 48px; + + justify-content: center; + + grid-template-columns: repeat(1, 200px); + + @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/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..eb09bf731f --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,77 @@ +$header-color: #fff; +$text-color: #060b35; +$selected-color: #00acdc; +$header-font-size: 12px; +$header-height: 60px; + +html { + font-family: Roboto, Arial, sans-serif; +} + +body { + margin: 0; + overflow-x: hidden; + box-sizing: border-box; +} + +.header { + background-color: $header-color; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + + &__logo { + display: flex; + align-items: center; + } + + &__image { + display: block; + object-fit: contain; + height: 40px; + width: auto; + } +} + +.nav { + &__list { + display: flex; + margin: 0; + padding: 0; + list-style: none; + } + &__item:not(:first-child) { + margin-left: 20px; + } + + &__link { + display: flex; + align-items: center; + position: relative; + height: $header-height; + color: $text-color; + text-decoration: none; + text-transform: uppercase; + white-space: nowrap; + font-size: $header-font-size; + font-weight: 500; + transition: color 300ms ease; + + &:hover, + &:active, + &.is-active { + color: $selected-color; + } + + &.is-active::after { + content: ''; + position: absolute; + left: 0; + bottom: 0; + height: 4px; + width: 100%; + background-color: $selected-color; + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss deleted file mode 100644 index 293d3b1f13..0000000000 --- a/src/styles/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -body { - margin: 0; -} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..8027a27237 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,22 @@ +.stars { + display: flex; + padding: 0; + margin: 0; +} + +.stars__star { + width: 16px; + height: 16px; + display: block; + background-repeat: no-repeat; + background-position: center; + background-image: url('../images/star.svg'); +} + +.stars__star:not(:last-child) { + margin-right: 4px; +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); +} From 53a0dd878aaef1844f52df6c6d4bad4471bf53d5 Mon Sep 17 00:00:00 2001 From: Abdalla Tayyah Date: Thu, 4 Jun 2026 16:42:07 +0300 Subject: [PATCH 2/5] feat: load solution --- src/styles/card.scss | 73 +++++++++++++------------------------------- 1 file changed, 22 insertions(+), 51 deletions(-) diff --git a/src/styles/card.scss b/src/styles/card.scss index 2e43473a2d..709481808f 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -10,11 +10,10 @@ body { } .card { - position: relative; display: flex; flex-direction: column; width: 200px; - height: 408px; + padding: 33px 17px 17px; background-color: #fff; border-radius: 5px; border: 1px solid #f3f3f3; @@ -22,64 +21,62 @@ body { transition: transform 300ms ease, box-shadow 300ms ease; - z-index: 1; &__image { - position: absolute; width: 160px; height: 134px; - top: 33px; - left: 20px; + align-self: center; + margin-bottom: 40px; + object-fit: contain; } &__title { color: #060b35; - position: absolute; font-weight: 500; font-size: 12px; line-height: 18px; - - width: 166px; - height: 36px; - top: 207px; - left: 17px; + margin-bottom: 4px; transition: color 300ms ease; - .card__title { + &:hover { color: #34568b; } } &__code { - position: absolute; color: #616070; font-weight: 400; font-size: 10px; line-height: 14px; + margin-bottom: 16px; + } + + &__rating { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24px; - width: 98px; - height: 14px; - top: 247px; - left: 17px; + &-reviews { + color: #060b35; + font-weight: 400; + font-size: 10px; + line-height: 14px; + } } &__price { - position: absolute; - top: 317px; - left: 17px; - width: 166px; - display: flex; align-items: center; justify-content: space-between; + margin-bottom: 16px; &-label { color: #616070; font-weight: 400; font-size: 12px; line-height: 18px; - margin: 0; } &-value { @@ -87,41 +84,15 @@ body { font-weight: 700; font-size: 16px; line-height: 18px; - margin: 0; - } - } - - &__rating { - position: absolute; - width: 166px; - height: 16px; - top: 277px; - left: 17px; - - display: flex; - align-items: center; - justify-content: space-between; - - &-reviews { - color: #060b35; - font-weight: 400; - font-size: 10px; - line-height: 14px; - margin: 0; } } &__button { - position: absolute; - width: 166px; + width: 100%; height: 40px; - top: 351px; - left: 17px; border-radius: 5px; background-color: #00acdc; - box-sizing: border-box; - display: flex; align-items: center; justify-content: center; From a6e4b4d019220e63635bc8148957e3a7d4a26ab6 Mon Sep 17 00:00:00 2001 From: Abdalla Tayyah Date: Thu, 4 Jun 2026 18:00:16 +0300 Subject: [PATCH 3/5] add task solution --- readme.md | 6 +++--- src/styles/card.scss | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index acd5174814..81adf3e361 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://wzrivatel.github.io/layout_catalog/) +- [TEST REPORT LINK](https://wzrivatel.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/styles/card.scss b/src/styles/card.scss index 709481808f..7111597c04 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -13,7 +13,7 @@ body { display: flex; flex-direction: column; width: 200px; - padding: 33px 17px 17px; + padding: 32px 16px 16px; background-color: #fff; border-radius: 5px; border: 1px solid #f3f3f3; From 834edb722a02db7b3412916d7cef879e7612c599 Mon Sep 17 00:00:00 2001 From: Abdalla Tayyah Date: Thu, 4 Jun 2026 18:23:14 +0300 Subject: [PATCH 4/5] add task solution 2 --- src/styles/card.scss | 27 ++++++++++++++------------- src/styles/header.scss | 5 ++--- src/styles/variable.scss | 9 +++++++++ 3 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 src/styles/variable.scss diff --git a/src/styles/card.scss b/src/styles/card.scss index 7111597c04..411483d717 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -1,4 +1,5 @@ @import './stars'; +@import './variable'; body { font-family: Roboto, sans-serif; @@ -14,9 +15,9 @@ body { flex-direction: column; width: 200px; padding: 32px 16px 16px; - background-color: #fff; + background-color: $color-white; border-radius: 5px; - border: 1px solid #f3f3f3; + border: 1px solid $color-border; transition: transform 300ms ease, @@ -31,7 +32,7 @@ body { } &__title { - color: #060b35; + color: $color-primary; font-weight: 500; font-size: 12px; line-height: 18px; @@ -40,12 +41,12 @@ body { transition: color 300ms ease; &:hover { - color: #34568b; + color: $color-title-hover; } } &__code { - color: #616070; + color: $color-secondary; font-weight: 400; font-size: 10px; line-height: 14px; @@ -59,7 +60,7 @@ body { margin-bottom: 24px; &-reviews { - color: #060b35; + color: $color-primary; font-weight: 400; font-size: 10px; line-height: 14px; @@ -73,14 +74,14 @@ body { margin-bottom: 16px; &-label { - color: #616070; + color: $color-secondary; font-weight: 400; font-size: 12px; line-height: 18px; } &-value { - color: #060b35; + color: $color-primary; font-weight: 700; font-size: 16px; line-height: 18px; @@ -91,13 +92,13 @@ body { width: 100%; height: 40px; border-radius: 5px; - background-color: #00acdc; + background-color: $color-accent; display: flex; align-items: center; justify-content: center; - color: #fff; + color: $color-white; text-decoration: none; font-weight: 700; font-size: 14px; @@ -113,9 +114,9 @@ body { border-color 300ms ease; &:hover { - background-color: #fff; - border-color: #00acdc; - color: #00acdc; + background-color: $color-white; + border-color: $color-accent; + color: $color-accent; } } diff --git a/src/styles/header.scss b/src/styles/header.scss index eb09bf731f..bc89251232 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -1,9 +1,8 @@ -$header-color: #fff; -$text-color: #060b35; -$selected-color: #00acdc; $header-font-size: 12px; $header-height: 60px; +@import './variable'; + html { font-family: Roboto, Arial, sans-serif; } diff --git a/src/styles/variable.scss b/src/styles/variable.scss new file mode 100644 index 0000000000..e54fcbecce --- /dev/null +++ b/src/styles/variable.scss @@ -0,0 +1,9 @@ +$color-primary: #060b35; +$color-secondary: #616070; +$color-accent: #00acdc; +$color-white: #fff; +$color-border: #f3f3f3; +$color-title-hover: #34568b; +$header-color: #fff; +$text-color: #060b35; +$selected-color: #00acdc; From 285b69a71434f2e6fac140d541d83e95e19ef20c Mon Sep 17 00:00:00 2001 From: Abdalla Tayyah Date: Fri, 5 Jun 2026 12:42:32 +0300 Subject: [PATCH 5/5] add task solution 3 --- src/index.html | 42 +++++++--------------------------------- src/styles/card.scss | 6 +++--- src/styles/variable.scss | 2 ++ 3 files changed, 12 insertions(+), 38 deletions(-) diff --git a/src/index.html b/src/index.html index 33cb150f20..0bd177aac5 100644 --- a/src/index.html +++ b/src/index.html @@ -154,10 +154,7 @@

-
+ -
+ -
+ -
+ -
+ -
+ -
+
Buy diff --git a/src/styles/card.scss b/src/styles/card.scss index 411483d717..799bb6e11c 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -16,7 +16,7 @@ body { width: 200px; padding: 32px 16px 16px; background-color: $color-white; - border-radius: 5px; + border-radius: $border-radius; border: 1px solid $color-border; transition: @@ -40,7 +40,7 @@ body { transition: color 300ms ease; - &:hover { + &:hover &__title { color: $color-title-hover; } } @@ -123,6 +123,6 @@ body { &:hover { transform: scale(1.2); z-index: 10; - box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); + box-shadow: 0 10px 20px $shadow-color; } } diff --git a/src/styles/variable.scss b/src/styles/variable.scss index e54fcbecce..baf316b77b 100644 --- a/src/styles/variable.scss +++ b/src/styles/variable.scss @@ -7,3 +7,5 @@ $color-title-hover: #34568b; $header-color: #fff; $text-color: #060b35; $selected-color: #00acdc; +$shadow-color: rgba(0, 0, 0, 0.15); +$border-radius: 5px;