From 2d6a03df16548fe7e7b9443f18bb5f238199b2dd Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Thu, 7 Nov 2024 14:59:43 +0200 Subject: [PATCH 1/2] created catalog --- readme.md | 6 +- src/index.html | 408 ++++++++++++++++++++++++++++++++++++++++- src/styles/body.scss | 9 + src/styles/card.scss | 110 +++++++++++ src/styles/header.scss | 66 +++++++ src/styles/index.scss | 8 +- src/styles/main.scss | 30 +++ src/styles/stars.scss | 24 +++ 8 files changed, 653 insertions(+), 8 deletions(-) create mode 100644 src/styles/body.scss create mode 100644 src/styles/card.scss create mode 100644 src/styles/header.scss create mode 100644 src/styles/main.scss create mode 100644 src/styles/stars.scss diff --git a/readme.md b/readme.md index 874ca70d97..5fa248ec68 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://vikapazyuk.github.io/layout_catalog/) +- [TEST REPORT LINK](https://vikapazyuk.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..fcdf3a742a 100644 --- a/src/index.html +++ b/src/index.html @@ -21,7 +21,411 @@ /> - -

Catalog

+ +
+ + +
+ +
+
+
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+ +
+ imac image + +

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

+

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+
+
diff --git a/src/styles/body.scss b/src/styles/body.scss new file mode 100644 index 0000000000..29a945fdcb --- /dev/null +++ b/src/styles/body.scss @@ -0,0 +1,9 @@ +.body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 400; + font-size: 10px; + line-height: 14px; + color: #060b35; + box-sizing: border-box; +} diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..6017e027fb --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,110 @@ +.card { + display: flex; + flex-direction: column; + justify-content: center; + width: 200px; + padding: 32px 16px 16px; + background-color: #fff; + border: 1px solid #f3f3f3; + border-radius: 5px; + box-sizing: border-box; + transition: all 0.3s; + + &:hover { + transform: scale(1.2); + transition: 0.3s; + } + + &__img { + margin-bottom: 40px; + min-height: 134px; + padding-inline: 3px; + } + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin-top: 0; + margin-bottom: 4px; + color: #060b35; + + &:hover .cart__title { + color: #34568b; + transition: 0, 3s; + } + } + + &__product-code { + font-size: 10px; + line-height: 14px; + color: #616070; + margin-top: 0; + margin-bottom: 16px; + width: 98px; + } + + &__stars { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 0; + margin-bottom: 24px; + height: 16px; + } + + &__reviews { + font-size: 10px; + color: #060b35; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 0; + margin-bottom: 16px; + height: 18px; + } + + &__name-price { + font-size: 12px; + line-height: 18px; + color: #616070; + } + + &__num-price { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: #060b35; + } + + &__button { + box-sizing: border-box; + padding: 0; + font-family: Roboto, sans-serif; + color: #fff; + width: 100%; + height: 40px; + font-weight: 700; + font-size: 14px; + line-height: 16px; + background-color: #00acdc; + border-radius: 5px; + border: 1px solid #00acdc; + outline: none; + display: flex; + justify-content: center; + align-items: center; + text-transform: uppercase; + text-align: center; + + &:hover { + background-color: white; + border: 1px solid #00acdc; + color: #00acdc; + transition: 0.3s; + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..9d8b539aff --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,66 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding-inline: 50px; + height: 60px; + box-shadow: 0 2px 4px 0 #0000000d; + + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; +} + +.logo__img { + display: block; +} + +.nav { + display: flex; +} + +.nav__list { + display: flex; + list-style: none; + padding: 0; + align-items: center; +} + +.nav__item { + margin-left: 20px; + position: relative; +} + +.nav__item:first-child { + margin-left: 0; +} + +.nav__link { + display: block; + position: relative; + color: #060b35; + text-decoration: none; + text-align: center; + line-height: 60px; + text-transform: uppercase; +} + +.nav__link:hover { + color: #00acdc; +} + +.is-active { + color: #00acdc; + position: relative; +} + +.is-active::after { + content: ''; + display: block; + width: 100%; + height: 4px; + position: absolute; + background-color: #00acdc; + bottom: 0; + border-radius: 8px; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..9e9b69db87 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,5 @@ -body { - margin: 0; -} +@import './body'; +@import './header'; +@import './main'; +@import './stars'; +@import './card'; diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..deb02072d0 --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,30 @@ +.main { + display: flex; + justify-content: center; + align-items: center; +} + +.main__container { + display: grid; + padding: 50px 40px; + grid-template-columns: repeat(var(--count-size-monitor), 200px); + gap: 46px 48px; +} + +@media (min-width: 488px) { + .main__container { + --count-size-monitor: 2; + } +} + +@media (min-width: 768px) { + .main__container { + --count-size-monitor: 3; + } +} + +@media (min-width: 1024px) { + .main__container { + --count-size-monitor: 4; + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..e163aa2f40 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,24 @@ +.stars { + display: flex; + align-items: center; + justify-content: space-between; + + &__star { + background-image: url('../images/star.svg'); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + margin-right: 4px; + } + + .stars__star:last-child { + margin-right: 0; + } + + &--4 .stars__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); + background-repeat: no-repeat; + background-position: center; + } +} From 232366734b490f404c261a26db637fffc29c6e19 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Thu, 7 Nov 2024 15:11:28 +0200 Subject: [PATCH 2/2] created catalog --- src/styles/card.scss | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/styles/card.scss b/src/styles/card.scss index 6017e027fb..731bcfd694 100644 --- a/src/styles/card.scss +++ b/src/styles/card.scss @@ -12,9 +12,9 @@ &:hover { transform: scale(1.2); - transition: 0.3s; } + &__img { margin-bottom: 40px; min-height: 134px; @@ -28,11 +28,10 @@ margin-top: 0; margin-bottom: 4px; color: #060b35; + } - &:hover .cart__title { - color: #34568b; - transition: 0, 3s; - } + &:hover .card__title { + color: #34568b; } &__product-code {