From c3f071604eb3fbf95a95f22ae0be662482fb6b43 Mon Sep 17 00:00:00 2001 From: Kostiantyn Date: Mon, 25 May 2026 15:51:58 +0300 Subject: [PATCH 1/2] Well Done! --- readme.md | 6 +- src/index.html | 384 ++++++++++++++++++++++++++++++++++++++++- src/styles/card.scss | 171 ++++++++++++++++++ src/styles/header.scss | 57 ++++++ src/styles/index.scss | 6 + src/styles/stars.scss | 24 +++ src/styles/var.scss | 15 ++ 7 files changed, 659 insertions(+), 4 deletions(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/var.scss diff --git a/readme.md b/readme.md index acd5174814..a2089fc54a 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://KOSTII177.github.io/layout_catalog/) +- [TEST REPORT LINK](https://KOSTII177.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..057f565e32 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,388 @@ -

Catalog

+
+ + +
+ +
+
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

+ 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..48fb9544ab --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,171 @@ +.catalog { + padding: $catalog-padding; + display: grid; + justify-content: center; + align-items: start; + gap: $column-gap $row-gap; +} + +.card { + overflow: visible; + box-sizing: border-box; + background-color: $white-accent; + width: $card-width; + border: 1px solid $bg-fon; + border-radius: 5px; + padding: 32px 16px 16px; + transform-origin: center; + transition: transform 300ms; + + &:hover { + cursor: pointer; + transform: scale(1.2); + z-index: 2; + } + + &__photo { + display: block; + box-sizing: border-box; + margin-inline: auto; + width: 160px; + height: 134px; + } + + &__main { + margin-top: 40px; + margin-bottom: 16px; + } + + &__title { + font-family: $font-main; + font-weight: 500; + font-size: 12px; + line-height: 18px; + letter-spacing: 0; + color: $main-accent; + margin: 0; + width: 166px; + margin-bottom: 4px; + transition: color 300ms ease; + } + + &__code { + font-family: $font-main; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $secondary-accent; + letter-spacing: 0; + margin: 0; + } + + &__button { + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + color: $white-accent; + text-transform: uppercase; + text-decoration: none; + font-family: $font-main; + font-weight: 700; + font-size: 14px; + text-align: center; + line-height: 16px; + letter-spacing: 0; + background-color: $blue-accent; + border: 1px solid $blue-accent; + border-radius: 5px; + width: 166px; + height: 40px; + margin: 0; + padding: 0; + transition: + background-color 300ms, + color 300ms, + border 300ms; + + &:hover { + box-sizing: border-box; + cursor: pointer; + background-color: $white-accent; + border: 1px solid $blue-accent; + color: $blue-accent; + } + } + + &__price { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; + } + + &__text { + color: #616070; + text-align: left; + font-weight: 400; + font-size: 12px; + line-height: 18px; + margin: 0; + } + + &__suma { + color: #060b35; + text-align: right; + line-height: 18px; + font-weight: 700; + font-size: 16px; + margin: 0; + } + + &__container { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__reviews { + justify-content: center; + align-items: center; + column-gap: 17px; + font-family: $font-main; + font-weight: 400; + font-size: 10px; + line-height: 14px; + letter-spacing: 0; + color: $main-accent; + margin: 0; + padding: 0; + } +} + +.card:hover .card__title { + color: $card-hover-color; +} + +@media (max-width: 487px) { + .catalog { + grid-template-columns: repeat(1, $card-width); + } +} + +@media (min-width: 488px) and (max-width: 767px) { + .catalog { + grid-template-columns: repeat(2, $card-width); + } +} + +@media (min-width: 488px) and (max-width: 1023px) { + .catalog { + grid-template-columns: repeat(3, $card-width); + } +} + +@media (min-width: 1024px) { + .catalog { + 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..2a72d9bf94 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,57 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + background-color: $white-accent; +} + +.logo__image { + height: $logo-height; + width: $logo-width; + display: block; +} + +.main-nav { + &__list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + align-items: center; + } + + &__item:not(:last-child) { + margin-right: 20px; + } + + &__link { + text-decoration: none; + font-weight: 500; + color: $main-accent; + font-size: 12px; + display: flex; + align-items: center; + justify-content: center; + text-transform: uppercase; + height: 60px; + position: relative; + transition: color 300ms ease; + } + + &__link:hover, + &__link.is-active { + color: $blue-accent; + } + + &__link.is-active::after { + content: ''; + position: absolute; + height: 4px; + background: $blue-accent; + width: 100%; + left: 0; + bottom: 0; + border-radius: 8px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..b57bfbae49 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,9 @@ +@import '/src/styles/var'; +@import '/src/styles/header'; +@import '/src/styles/card'; +@import '/src/styles/stars'; + body { margin: 0; + font-family: $font-main; } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..532e88d6ad --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,24 @@ +.stars { + display: flex; + + &__star { + background-image: url('../images/star.svg'); + background-position: center; + background-repeat: no-repeat; + width: $star-width; + height: $star-height; + margin-right: 4px; + + &:last-child { + margin-right: 0; + } + } + + @for $i from 1 through 5 { + &--#{$i} { + .stars__star:nth-child(-n + #{$i}) { + background-image: url('../images/star-active.svg'); + } + } + } +} diff --git a/src/styles/var.scss b/src/styles/var.scss new file mode 100644 index 0000000000..702717414d --- /dev/null +++ b/src/styles/var.scss @@ -0,0 +1,15 @@ +$font-main: Roboto, sans-serif; +$main-accent: #060b35; +$secondary-accent: #616070; +$blue-accent: #00acdc; +$white-accent: #fff; +$bg-fon: #f3f3f3; +$card-hover-color: #34568b; +$card-width: 200px; +$star-width: 16px; +$star-height: 16px; +$row-gap: 48px; +$column-gap: 46px; +$catalog-padding: 50px 40px; +$logo-height: 40px; +$logo-width: 40px; From f935435ace26ed97576886847336ed1eff5faa49 Mon Sep 17 00:00:00 2001 From: Kostiantyn Date: Tue, 26 May 2026 11:29:07 +0300 Subject: [PATCH 2/2] Done v.2 --- src/index.html | 384 ++++++++++++++++++++++++++++++++++++++++- src/styles/card.scss | 171 ++++++++++++++++++ src/styles/header.scss | 57 ++++++ src/styles/index.scss | 6 + src/styles/stars.scss | 24 +++ src/styles/var.scss | 15 ++ 6 files changed, 656 insertions(+), 1 deletion(-) create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/var.scss diff --git a/src/index.html b/src/index.html index 9cff78eeb7..057f565e32 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,388 @@ -

Catalog

+
+ + +
+ +
+
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

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

+

Product code: 195434

+
+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ monitor +
+

+ 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..48fb9544ab --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,171 @@ +.catalog { + padding: $catalog-padding; + display: grid; + justify-content: center; + align-items: start; + gap: $column-gap $row-gap; +} + +.card { + overflow: visible; + box-sizing: border-box; + background-color: $white-accent; + width: $card-width; + border: 1px solid $bg-fon; + border-radius: 5px; + padding: 32px 16px 16px; + transform-origin: center; + transition: transform 300ms; + + &:hover { + cursor: pointer; + transform: scale(1.2); + z-index: 2; + } + + &__photo { + display: block; + box-sizing: border-box; + margin-inline: auto; + width: 160px; + height: 134px; + } + + &__main { + margin-top: 40px; + margin-bottom: 16px; + } + + &__title { + font-family: $font-main; + font-weight: 500; + font-size: 12px; + line-height: 18px; + letter-spacing: 0; + color: $main-accent; + margin: 0; + width: 166px; + margin-bottom: 4px; + transition: color 300ms ease; + } + + &__code { + font-family: $font-main; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: $secondary-accent; + letter-spacing: 0; + margin: 0; + } + + &__button { + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + color: $white-accent; + text-transform: uppercase; + text-decoration: none; + font-family: $font-main; + font-weight: 700; + font-size: 14px; + text-align: center; + line-height: 16px; + letter-spacing: 0; + background-color: $blue-accent; + border: 1px solid $blue-accent; + border-radius: 5px; + width: 166px; + height: 40px; + margin: 0; + padding: 0; + transition: + background-color 300ms, + color 300ms, + border 300ms; + + &:hover { + box-sizing: border-box; + cursor: pointer; + background-color: $white-accent; + border: 1px solid $blue-accent; + color: $blue-accent; + } + } + + &__price { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; + } + + &__text { + color: #616070; + text-align: left; + font-weight: 400; + font-size: 12px; + line-height: 18px; + margin: 0; + } + + &__suma { + color: #060b35; + text-align: right; + line-height: 18px; + font-weight: 700; + font-size: 16px; + margin: 0; + } + + &__container { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__reviews { + justify-content: center; + align-items: center; + column-gap: 17px; + font-family: $font-main; + font-weight: 400; + font-size: 10px; + line-height: 14px; + letter-spacing: 0; + color: $main-accent; + margin: 0; + padding: 0; + } +} + +.card:hover .card__title { + color: $card-hover-color; +} + +@media (max-width: 487px) { + .catalog { + grid-template-columns: repeat(1, $card-width); + } +} + +@media (min-width: 488px) and (max-width: 767px) { + .catalog { + grid-template-columns: repeat(2, $card-width); + } +} + +@media (min-width: 488px) and (max-width: 1023px) { + .catalog { + grid-template-columns: repeat(3, $card-width); + } +} + +@media (min-width: 1024px) { + .catalog { + 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..2a72d9bf94 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,57 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + background-color: $white-accent; +} + +.logo__image { + height: $logo-height; + width: $logo-width; + display: block; +} + +.main-nav { + &__list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + align-items: center; + } + + &__item:not(:last-child) { + margin-right: 20px; + } + + &__link { + text-decoration: none; + font-weight: 500; + color: $main-accent; + font-size: 12px; + display: flex; + align-items: center; + justify-content: center; + text-transform: uppercase; + height: 60px; + position: relative; + transition: color 300ms ease; + } + + &__link:hover, + &__link.is-active { + color: $blue-accent; + } + + &__link.is-active::after { + content: ''; + position: absolute; + height: 4px; + background: $blue-accent; + width: 100%; + left: 0; + bottom: 0; + border-radius: 8px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..b57bfbae49 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,9 @@ +@import '/src/styles/var'; +@import '/src/styles/header'; +@import '/src/styles/card'; +@import '/src/styles/stars'; + body { margin: 0; + font-family: $font-main; } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..532e88d6ad --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,24 @@ +.stars { + display: flex; + + &__star { + background-image: url('../images/star.svg'); + background-position: center; + background-repeat: no-repeat; + width: $star-width; + height: $star-height; + margin-right: 4px; + + &:last-child { + margin-right: 0; + } + } + + @for $i from 1 through 5 { + &--#{$i} { + .stars__star:nth-child(-n + #{$i}) { + background-image: url('../images/star-active.svg'); + } + } + } +} diff --git a/src/styles/var.scss b/src/styles/var.scss new file mode 100644 index 0000000000..702717414d --- /dev/null +++ b/src/styles/var.scss @@ -0,0 +1,15 @@ +$font-main: Roboto, sans-serif; +$main-accent: #060b35; +$secondary-accent: #616070; +$blue-accent: #00acdc; +$white-accent: #fff; +$bg-fon: #f3f3f3; +$card-hover-color: #34568b; +$card-width: 200px; +$star-width: 16px; +$star-height: 16px; +$row-gap: 48px; +$column-gap: 46px; +$catalog-padding: 50px 40px; +$logo-height: 40px; +$logo-width: 40px;