From 0738bc0e85da8590817e4c998af87b7dc98e89e5 Mon Sep 17 00:00:00 2001 From: Valentyn Date: Sat, 7 Dec 2024 17:53:35 +0200 Subject: [PATCH 01/16] add --- readme.md | 12 +- src/index.html | 396 +++++++++++++++++++++++++++++++++++++++++- src/styles/index.scss | 223 ++++++++++++++++++++++++ 3 files changed, 625 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index 874ca70d97..1ed18066c2 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page -Create an HTML page with a catalog. Develop semantic page structure as shown on [the mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=32249%3A354). +Create an HTML page with a catalog. Develop semantic page structure as shown on [the mockup](). - use `Header`, `Stars` and `Card` blocks from previous tasks but rewrite them using BEM and SCSS - remove old `data-qa` attributes @@ -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` @@ -20,6 +20,7 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on - cards container(catalog) have fixed paddings (`50px` vertically and `40px` horizontally) Make all the changes smooth on hover (during 300ms): + - increase the card by 20 percent (neighboring cards **should not be** affected) - change the card title text color to `#34568b` when the card is hovered (`.card:hover .card__title`) - change navigation link text color to `#00acdc` @@ -27,14 +28,15 @@ Make all the changes smooth on hover (during 300ms): > Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline) -*Important note*: In this task, you are allowed to link `*.scss` files directly in HTML `` tags using `href` attribute. +_Important note_: In this task, you are allowed to link `*.scss` files directly in HTML `` tags using `href` attribute. This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle your solution's source code. ## 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://Valbel93.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Valbel93.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..a45ea5a506 100644 --- a/src/index.html +++ b/src/index.html @@ -19,9 +19,403 @@ rel="stylesheet" href="styles/index.scss" /> + + + + -

Catalog

+ +
+ + Moyo-Logo + + + +
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
+ imac + +

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

Product code: 195434

+

+ +
+
+
+
+
+
+
Reviews: 5
+
+ +
+ Price: +
$2,199
+
+ + +
+
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..0a9cee3194 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,226 @@ +html { + font-family: Roboto, sans-serif; +} + +:root { + --font-family: Roboto, sans-serif; + --color: #00acdc; + --main-accent: #060b35; + --secondary: #616070; + --white: #fff; + --blue-accent: #00acdc; + --gray-elements: #f3f3f3; + --yellow-stars: #ffde6a; +} + body { margin: 0; } + +// <-- #logo moyo end --> +.header { + // width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + width: 1024px; + height: 60px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); +} + +.nav__link { + font-size: 12px; + text-decoration: none; + color: #060b35; + padding-top: 22.5px; + padding-bottom: 22.5px; +} + +.nav__list { + list-style-type: none; + display: flex; + flex-wrap: nowrap; +} + +.nav__item { + justify-content: center; + align-items: center; + font-weight: 500; + font-size: 12px; + text-transform: uppercase; + margin-right: 20px; +} + +.nav { + padding-top: 6px; + padding-right: 30px; +} + +.img { + height: 40px; + width: 40px; + margin-top: 10px; + margin-left: 50px; + margin-bottom: 10px; +} + +.is-active { + position: relative; + border-radius: 8px; + width: 37px; + height: 4px; + margin-top: 57px; + color: #00acdc; +} + +.is-active::after { + position: absolute; + content: ''; + left: 0; + width: 100%; + bottom: 0; + margin-top: 56px; + height: 4px; + background-color: #00acdc; + border-radius: 8px; +} + +.nav__link:hover { + color: #00acdc; +} + +main { + gap: 135px; + display: grid; + grid-template-columns: repeat(4, 113px); + row-gap: 46px; + width: 944px; + margin: 40px; + margin-top: 50px; +} + +.card { + border: 1px solid var(--gray-elements); + border-radius: 5px; + width: 198px; + height: 406px; + background-color: var(--white); + justify-content: center; +} + +.card__img { + width: 160px; + height: 134px; + margin: 32px 19px 36px; +} + +.card__name { + font-weight: 500; + font-size: 12px; + line-height: 150%; + color: #060b35; + margin: 0 16px 4px; +} + +.card__code { + font-weight: 400; + font-size: 10px; + line-height: 140%; + color: #616070; + margin-top: 4px; +} + +.stars { + gap: 4px; + margin-top: 16px; + display: flex; + margin-left: 16px; + margin-bottom: 24px; + + &__star { + background-image: url(/src/images/star.svg); + background-position: 50%; + background-repeat: no-repeat; + width: 16px; + height: 16px; + } + + &__reviews { + font-family: var(--font-family); + margin-top: 1.7px; + margin-left: 18px; + margin-right: 16px; + font-weight: 400; + font-size: 10px; + line-height: 140%; + color: var(--main-accent); + text-align: right; + } +} + +.stars__star:nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); + background-repeat: no-repeat; +} + +.card__price { + font-family: var(--font-family); + display: flex; + font-weight: 400; + font-size: 12px; + line-height: 150%; + color: var(--secondary); + margin-left: 16px; + margin-bottom: 16px; +} + +.card__price-value { + font-family: var(--font-family); + display: block; + font-weight: 700; + font-size: 16px; + line-height: 112%; + text-align: right; + margin-left: 85px; + color: var(--main-accent); +} + +button { + display: block; + font-family: var(--font-family); + width: 166px; + height: 40px; + margin: 0 16px 16px; + border-radius: 5px; + border: 1px solid #00acdc; + color: #fff; + background-color: #00acdc; + font-size: 14px; + line-height: 16px; + font-weight: 700; + + &__button-buy { + font-family: var(--font-family); + font-size: 14px; + line-height: 16px; + font-weight: 700; + text-transform: uppercase; + text-align: center; + border: 1px solid #00acdc; + color: var(--white); + background-color: #00acdc; + } +} + +.card__button-buy:hover { + font-family: var(--font-family); + font-size: 14px; + line-height: 16px; + font-weight: 700; + text-transform: uppercase; + text-align: center; + border-radius: 5px; + border: 1px solid var(--blue-accent); + color: var(--blue-accent); + background-color: var(--white); +} From 9d7a07b69abd5b689a76fc0325eeae2aa86328d2 Mon Sep 17 00:00:00 2001 From: Valentyn Date: Sat, 7 Dec 2024 18:18:39 +0200 Subject: [PATCH 02/16] add solution --- src/styles/header.scss | 70 ++++++++++++++ src/styles/index.scss | 211 +---------------------------------------- src/styles/main.scss | 135 ++++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 208 deletions(-) create mode 100644 src/styles/header.scss create mode 100644 src/styles/main.scss diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..a608abfaef --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,70 @@ +.header { + // width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + width: 1024px; + height: 60px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); +} + +.nav__link { + font-size: 12px; + text-decoration: none; + color: #060b35; + padding-top: 22.5px; + padding-bottom: 22.5px; +} + +.nav__list { + list-style-type: none; + display: flex; + flex-wrap: nowrap; +} + +.nav__item { + justify-content: center; + align-items: center; + font-weight: 500; + font-size: 12px; + text-transform: uppercase; + margin-right: 20px; +} + +.nav { + padding-top: 6px; + padding-right: 30px; +} + +.img { + height: 40px; + width: 40px; + margin-top: 10px; + margin-left: 50px; + margin-bottom: 10px; +} + +.is-active { + position: relative; + border-radius: 8px; + width: 37px; + height: 4px; + margin-top: 57px; + color: #00acdc; +} + +.is-active::after { + position: absolute; + content: ''; + left: 0; + width: 100%; + bottom: 0; + margin-top: 56px; + height: 4px; + background-color: #00acdc; + border-radius: 8px; +} + +.nav__link:hover { + color: #00acdc; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 0a9cee3194..b3e8b0c2cc 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,6 @@ +@import 'header'; +@import 'main'; + html { font-family: Roboto, sans-serif; } @@ -16,211 +19,3 @@ html { body { margin: 0; } - -// <-- #logo moyo end --> -.header { - // width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - width: 1024px; - height: 60px; - box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); -} - -.nav__link { - font-size: 12px; - text-decoration: none; - color: #060b35; - padding-top: 22.5px; - padding-bottom: 22.5px; -} - -.nav__list { - list-style-type: none; - display: flex; - flex-wrap: nowrap; -} - -.nav__item { - justify-content: center; - align-items: center; - font-weight: 500; - font-size: 12px; - text-transform: uppercase; - margin-right: 20px; -} - -.nav { - padding-top: 6px; - padding-right: 30px; -} - -.img { - height: 40px; - width: 40px; - margin-top: 10px; - margin-left: 50px; - margin-bottom: 10px; -} - -.is-active { - position: relative; - border-radius: 8px; - width: 37px; - height: 4px; - margin-top: 57px; - color: #00acdc; -} - -.is-active::after { - position: absolute; - content: ''; - left: 0; - width: 100%; - bottom: 0; - margin-top: 56px; - height: 4px; - background-color: #00acdc; - border-radius: 8px; -} - -.nav__link:hover { - color: #00acdc; -} - -main { - gap: 135px; - display: grid; - grid-template-columns: repeat(4, 113px); - row-gap: 46px; - width: 944px; - margin: 40px; - margin-top: 50px; -} - -.card { - border: 1px solid var(--gray-elements); - border-radius: 5px; - width: 198px; - height: 406px; - background-color: var(--white); - justify-content: center; -} - -.card__img { - width: 160px; - height: 134px; - margin: 32px 19px 36px; -} - -.card__name { - font-weight: 500; - font-size: 12px; - line-height: 150%; - color: #060b35; - margin: 0 16px 4px; -} - -.card__code { - font-weight: 400; - font-size: 10px; - line-height: 140%; - color: #616070; - margin-top: 4px; -} - -.stars { - gap: 4px; - margin-top: 16px; - display: flex; - margin-left: 16px; - margin-bottom: 24px; - - &__star { - background-image: url(/src/images/star.svg); - background-position: 50%; - background-repeat: no-repeat; - width: 16px; - height: 16px; - } - - &__reviews { - font-family: var(--font-family); - margin-top: 1.7px; - margin-left: 18px; - margin-right: 16px; - font-weight: 400; - font-size: 10px; - line-height: 140%; - color: var(--main-accent); - text-align: right; - } -} - -.stars__star:nth-child(-n + 4) { - background-image: url(/src/images/star-active.svg); - background-repeat: no-repeat; -} - -.card__price { - font-family: var(--font-family); - display: flex; - font-weight: 400; - font-size: 12px; - line-height: 150%; - color: var(--secondary); - margin-left: 16px; - margin-bottom: 16px; -} - -.card__price-value { - font-family: var(--font-family); - display: block; - font-weight: 700; - font-size: 16px; - line-height: 112%; - text-align: right; - margin-left: 85px; - color: var(--main-accent); -} - -button { - display: block; - font-family: var(--font-family); - width: 166px; - height: 40px; - margin: 0 16px 16px; - border-radius: 5px; - border: 1px solid #00acdc; - color: #fff; - background-color: #00acdc; - font-size: 14px; - line-height: 16px; - font-weight: 700; - - &__button-buy { - font-family: var(--font-family); - font-size: 14px; - line-height: 16px; - font-weight: 700; - text-transform: uppercase; - text-align: center; - border: 1px solid #00acdc; - color: var(--white); - background-color: #00acdc; - } -} - -.card__button-buy:hover { - font-family: var(--font-family); - font-size: 14px; - line-height: 16px; - font-weight: 700; - text-transform: uppercase; - text-align: center; - border-radius: 5px; - border: 1px solid var(--blue-accent); - color: var(--blue-accent); - background-color: var(--white); -} diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..5df958af73 --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,135 @@ +main { + gap: 135px; + display: grid; + grid-template-columns: repeat(4, 113px); + row-gap: 46px; + width: 944px; + margin: 40px; + margin-top: 50px; +} + +.card { + border: 1px solid var(--gray-elements); + border-radius: 5px; + width: 198px; + height: 406px; + background-color: var(--white); + justify-content: center; +} + +.card__img { + width: 160px; + height: 134px; + margin: 32px 19px 36px; +} + +.card__name { + font-weight: 500; + font-size: 12px; + line-height: 150%; + color: #060b35; + margin: 0 16px 4px; +} + +.card__code { + font-weight: 400; + font-size: 10px; + line-height: 140%; + color: #616070; + margin-top: 4px; +} + +.stars { + gap: 4px; + margin-top: 16px; + display: flex; + margin-left: 16px; + margin-bottom: 24px; + + &__star { + background-image: url(/src/images/star.svg); + background-position: 50%; + background-repeat: no-repeat; + width: 16px; + height: 16px; + } + + &__reviews { + font-family: var(--font-family); + margin-top: 1.7px; + margin-left: 18px; + margin-right: 16px; + font-weight: 400; + font-size: 10px; + line-height: 140%; + color: var(--main-accent); + text-align: right; + } +} + +.stars__star:nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); + background-repeat: no-repeat; +} + +.card__price { + font-family: var(--font-family); + display: flex; + font-weight: 400; + font-size: 12px; + line-height: 150%; + color: var(--secondary); + margin-left: 16px; + margin-bottom: 16px; +} + +.card__price-value { + font-family: var(--font-family); + display: block; + font-weight: 700; + font-size: 16px; + line-height: 112%; + text-align: right; + margin-left: 85px; + color: var(--main-accent); +} + +button { + display: block; + font-family: var(--font-family); + width: 166px; + height: 40px; + margin: 0 16px 16px; + border-radius: 5px; + border: 1px solid #00acdc; + color: #fff; + background-color: #00acdc; + font-size: 14px; + line-height: 16px; + font-weight: 700; + + &__button-buy { + font-family: var(--font-family); + font-size: 14px; + line-height: 16px; + font-weight: 700; + text-transform: uppercase; + text-align: center; + border: 1px solid #00acdc; + color: var(--white); + background-color: #00acdc; + } +} + +.card__button-buy:hover { + font-family: var(--font-family); + font-size: 14px; + line-height: 16px; + font-weight: 700; + text-transform: uppercase; + text-align: center; + border-radius: 5px; + border: 1px solid var(--blue-accent); + color: var(--blue-accent); + background-color: var(--white); +} From bb2c53899d7df404a41e2aaacfc3438fce195e8e Mon Sep 17 00:00:00 2001 From: Valentyn Date: Sat, 7 Dec 2024 18:38:17 +0200 Subject: [PATCH 03/16] add blocks Stars/Haeder/Main --- src/styles/header.scss | 22 ++++++++++++++++++++-- src/styles/index.scss | 20 +------------------- src/styles/main.scss | 33 --------------------------------- src/styles/stars.scss | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 54 deletions(-) create mode 100644 src/styles/stars.scss diff --git a/src/styles/header.scss b/src/styles/header.scss index a608abfaef..c289135b99 100644 --- a/src/styles/header.scss +++ b/src/styles/header.scss @@ -1,5 +1,23 @@ -.header { - // width: 100%; +html { + font-family: Roboto, sans-serif; +} + +:root { + --font-family: Roboto, sans-serif; + --color: #00acdc; + --main-accent: #060b35; + --secondary: #616070; + --white: #fff; + --blue-accent: #00acdc; + --gray-elements: #f3f3f3; + --yellow-stars: #ffde6a; +} + +body { + margin: 0; +} + +header { display: flex; justify-content: space-between; align-items: center; diff --git a/src/styles/index.scss b/src/styles/index.scss index b3e8b0c2cc..b284f68507 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,21 +1,3 @@ @import 'header'; @import 'main'; - -html { - font-family: Roboto, sans-serif; -} - -:root { - --font-family: Roboto, sans-serif; - --color: #00acdc; - --main-accent: #060b35; - --secondary: #616070; - --white: #fff; - --blue-accent: #00acdc; - --gray-elements: #f3f3f3; - --yellow-stars: #ffde6a; -} - -body { - margin: 0; -} +@import 'stars'; diff --git a/src/styles/main.scss b/src/styles/main.scss index 5df958af73..0d82d7ae64 100644 --- a/src/styles/main.scss +++ b/src/styles/main.scss @@ -39,39 +39,6 @@ main { margin-top: 4px; } -.stars { - gap: 4px; - margin-top: 16px; - display: flex; - margin-left: 16px; - margin-bottom: 24px; - - &__star { - background-image: url(/src/images/star.svg); - background-position: 50%; - background-repeat: no-repeat; - width: 16px; - height: 16px; - } - - &__reviews { - font-family: var(--font-family); - margin-top: 1.7px; - margin-left: 18px; - margin-right: 16px; - font-weight: 400; - font-size: 10px; - line-height: 140%; - color: var(--main-accent); - text-align: right; - } -} - -.stars__star:nth-child(-n + 4) { - background-image: url(/src/images/star-active.svg); - background-repeat: no-repeat; -} - .card__price { font-family: var(--font-family); display: flex; diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..f4b88f6156 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,32 @@ +.stars { + gap: 4px; + margin-top: 16px; + display: flex; + margin-left: 16px; + margin-bottom: 24px; + + &__star { + background-image: url(/src/images/star.svg); + background-position: 50%; + background-repeat: no-repeat; + width: 16px; + height: 16px; + } + + &__reviews { + font-family: var(--font-family); + margin-top: 1.7px; + margin-left: 18px; + margin-right: 16px; + font-weight: 400; + font-size: 10px; + line-height: 140%; + color: var(--main-accent); + text-align: right; + } +} + +.stars__star:nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); + background-repeat: no-repeat; +} From 0f9a95d14815710be4b8258004a7971e84d5e383 Mon Sep 17 00:00:00 2001 From: Valentyn Date: Sat, 7 Dec 2024 19:05:58 +0200 Subject: [PATCH 04/16] solution for 1024 --- src/index.html | 2 +- src/styles/header.scss | 8 ++++++-- src/styles/main.scss | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index a45ea5a506..eaba2e9efb 100644 --- a/src/index.html +++ b/src/index.html @@ -80,7 +80,7 @@