From 04cd713e9aa438581fe6865f2689484d57d18b0e Mon Sep 17 00:00:00 2001 From: Vladyslav Kutsyn Date: Wed, 30 Oct 2024 13:21:49 +0100 Subject: [PATCH] add task solution --- readme.md | 12 +- src/index.html | 376 +++++++++++++++++++++++++++++++++++++++++- src/styles/index.scss | 265 ++++++++++++++++++++++++++++- 3 files changed, 643 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index cf0977c416..7481b8f3eb 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page -Create HTML page with 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 HTML page with 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 HTML page with catalog. Develop semantic page structure as shown on [the - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` any more (nav links should have `#060b35` color) - add class `is-active` to the first link (`Apple`) in navigation -- use `
` tag for cards container +- use `
` tag for cards container - use grid for cards with different number of columns: - 1 for the smaller screens - 2 starting at `488px` @@ -20,6 +20,7 @@ Create HTML page with catalog. Develop semantic page structure as shown on [the - cards container(catalog) have fixed paddings (`50px` vertically and `40px` horyzontally) 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,13 +28,14 @@ Make all the changes smooth on hover (during 300ms): > Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline) -*Note*: In this task, you can directly link `*.scss` files in HTML `` tags. This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle the source code. +_Note_: In this task, you can directly link `*.scss` files in HTML `` tags. This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle the source code. ## Checklist ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_catalog/) -- [TEST REPORT LINK](https://.github.io/layout_catalog/report/html_report/) + +- [DEMO LINK](https://d1nexl.github.io/layout_catalog/) +- [TEST REPORT LINK](https://d1nexl.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..92c34120cc 100644 --- a/src/index.html +++ b/src/index.html @@ -1,7 +1,7 @@ - + - -

Catalog

+
+ + +
+
+
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
+ Product code: 195434 +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ Card-Image +
+ 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..6f606225c1 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,266 @@ -body { +:root { + --bg-color: #00acdc; + --count-size-monitor: 1; +} + +* { + box-sizing: border-box; margin: 0; + padding: 0; + font-family: Roboto, sans-serif; +} + +body { + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; + line-height: 14px; +} + +.header { + background-color: #fff; + justify-content: space-between; + align-items: center; + height: 60px; + padding-right: 50px; + display: flex; + box-shadow: 0 2px 4px #0000000d; +} + +.header__logo { + height: 60px; +} + +.header__logo-moyo { + height: 40px; + margin-top: 10px; + margin-left: 50px; +} + +.nav { + justify-content: end; + align-items: center; + height: 60px; + display: flex; +} + +.nav__list { + flex-wrap: nowrap; + padding: 0; + list-style: none; + display: flex; +} + +.nav__item { + margin-right: 20px; + padding: 0; + position: relative; + line-height: 14.06px; +} + +.nav__item-button { + text-align: center; + color: #060b35; + cursor: pointer; + height: 100%; + line-height: 60px; + text-decoration: none; + display: inline-block; + position: relative; +} + +.nav__item:last-child { + margin-right: 0; +} + +.nav__item-button:hover, +.nav__item .is-active { + color: var(--bg-color); +} + +.is-active::after { + content: ''; + background-color: var(--bg-color); + opacity: 1; + border-radius: 8px; + width: 100%; + height: 4px; + position: absolute; + bottom: 0; + left: 0; +} + +.main { + justify-content: center; + height: 100vh; + display: flex; +} + +.main__container { + grid-template-columns: repeat(var(--count-size-monitor), 200px); + gap: 46px 48px; + width: fit-content; + height: fit-content; + margin: 50px 40px; + display: grid; +} + +@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; + } +} + +.card { + background-color: #fff; + border: 1px solid #f3f3f3; + border-radius: 5px; + width: 200px; + padding: 32px 16px 16px; + transition: all 0.3s; +} + +.card__image { + background-repeat: no-repeat; + background-size: auto; + width: 160px; + height: 134px; + margin: 0 auto; + display: block; +} + +.card__reviews { + color: #060b35; + height: 16px; + font-size: 10px; + font-weight: 400; + line-height: 14px; +} + +.card__txt { + color: #616070; + font-size: 12px; + font-weight: 400; + line-height: 18px; +} + +.card__price { + color: #060b35; + font-size: 16px; + font-weight: 700; + line-height: 18px; +} + +.card__description { + color: #060b35; + width: 166px; + height: 36px; + font-size: 12px; + font-weight: 500; + line-height: 18px; +} + +.card__description--margin--top { + margin-top: 40px; +} + +.card__code { + color: #616070; + width: 98px; + height: 14px; + font-size: 10px; + font-weight: 400; + line-height: 14px; +} + +.card__code--margin--top { + margin-top: 4px; +} + +.card__rating { + justify-content: space-between; + align-items: center; + width: 166px; + height: 16px; + display: flex; +} + +.card__rating--margin--top { + margin-top: 16px; +} + +.card__priceBlock { + justify-content: space-between; + align-items: center; + width: 166px; + height: 18px; + display: flex; +} + +.card__priceBlock--margin--top { + margin-top: 24px; +} + +.card__button { + color: #fff; + background-color: #00acdc; + border: 1px solid #00acdc; + border-radius: 5px; + justify-content: center; + align-items: center; + width: 166px; + height: 40px; + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-decoration: none; + display: flex; +} + +.card__button--margin--top { + margin-top: 16px; +} + +.card:hover { + transform: scale(1.2); + transition: 0.3s; +} + +.card__button:hover { + background: #fff; + color: #00acdc; + border: 1px solid #00acdc; + transition: 0.3s; +} + +.stars { + gap: 4px; + padding: 0; + list-style: none; + display: flex; +} + +.stars__area { + background-image: url(/src/images/star.svg); + background-position: 50%; + background-repeat: no-repeat; + background-size: auto; + width: 16px; + height: 16px; +} + +.stars__area:nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); }