diff --git a/readme.md b/readme.md index 874ca70d97..d900786f28 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://josiellinhar.github.io/layout_catalog/) +- [TEST REPORT LINK](https://josiellinhar.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..32b6b9b4fc 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,425 @@ -

Catalog

+
+ + + +
+ +
+
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+ +
+ Apple iMac + +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
diff --git a/src/styles/blocks/body.scss b/src/styles/blocks/body.scss new file mode 100644 index 0000000000..7719bc5bfa --- /dev/null +++ b/src/styles/blocks/body.scss @@ -0,0 +1,8 @@ +* { + box-sizing: border-box; +} + +body { + margin: 0; + padding: 0; +} diff --git a/src/styles/blocks/cards.scss b/src/styles/blocks/cards.scss new file mode 100644 index 0000000000..fa1f588def --- /dev/null +++ b/src/styles/blocks/cards.scss @@ -0,0 +1,115 @@ +.card { + width: 200px; + height: 408px; + padding: 32px 16px 16px; + + display: flex; + flex-direction: column; + + background-color: rgb(255, 255, 255); + border: 1px solid rgb(243, 243, 243); + border-radius: 5px; + + font-family: Roboto, sans-serif; + + transition: transform 300ms; + + &:hover { + transform: scale(1.2); + } + + &__img { + width: 160px; + height: 134px; + + display: block; + margin: 0 auto; + } + + &__title { + width: 100%; + font-size: 12px; + font-weight: 500; + line-height: 18px; + margin: 40px 0 4px; + + color: #060b35; + } + + &:hover &__title { + color: #34568b; + } + + &__text-code { + margin: 0; + font-size: 10px; + color: #616070; + font-weight: 400; + line-height: 14px; + } + + &__text-review { + margin: 0; + font-size: 10px; + color: #060b35; + font-weight: 400; + } + + &__review { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + margin-top: 16px; + } + + &__price { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + + margin-top: 24px; + margin-bottom: 16px; + } + + &__text-price { + font-size: 12px; + color: #616070; + line-height: 18px; + margin: 0; + } + + &__text-value { + margin: 0; + font-weight: 700; + font-size: 16px; + line-height: 18px; + } + + &__button { + width: 100%; + height: 40px; + margin: 0; + + display: flex; + justify-content: center; + align-items: center; + + font-size: 14px; + font-weight: 700; + text-decoration: none; + text-transform: uppercase; + + color: white; + background-color: $active-color; + border-radius: 5px; + } + + &:hover &__button { + background-color: #fff; + color: $active-color; + border: 1px solid $active-color; + } +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..570a2e9e55 --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,7 @@ +.header { + width: 100%; + padding: 0 50px; + display: flex; + align-items: center; + justify-content: space-between; +} diff --git a/src/styles/blocks/logo.scss b/src/styles/blocks/logo.scss new file mode 100644 index 0000000000..b4e0fc49b7 --- /dev/null +++ b/src/styles/blocks/logo.scss @@ -0,0 +1,9 @@ +.logo { + width: 40px; + height: 40px; + + &__img { + width: 100%; + height: 100%; + } +} diff --git a/src/styles/blocks/main.scss b/src/styles/blocks/main.scss new file mode 100644 index 0000000000..a16ba17910 --- /dev/null +++ b/src/styles/blocks/main.scss @@ -0,0 +1,25 @@ +.main { + display: grid; + grid-template-columns: 200px; + gap: 46px 48px; + padding: 50px 40px; + justify-content: center; + + @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/blocks/nav.scss b/src/styles/blocks/nav.scss new file mode 100644 index 0000000000..418ca1e40f --- /dev/null +++ b/src/styles/blocks/nav.scss @@ -0,0 +1,53 @@ +.nav { + &__list { + display: flex; + margin: 0; + padding: 0; + list-style: none; + } + + &__item { + margin: 0 10px; + } + + &__item:first-child { + margin-left: 0; + } + + &__item:last-child { + margin-right: 0; + } + + &__link { + position: relative; + display: flex; + align-items: center; + height: 60px; + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; + text-decoration: none; + text-transform: uppercase; + color: $normal-color; + + &:hover { + color: $active-color; + } + } +} + +.is-active { + color: $active-color; +} + +.is-active::after { + content: ''; + width: 100%; + height: 4px; + border-radius: 8px; + position: absolute; + bottom: 0; + left: 0; + + background-color: $active-color; +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..fa4e4df874 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,21 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + + &:last-child { + margin: 0; + } + + &:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..29875a91c8 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,8 @@ -body { - margin: 0; -} +@import 'utils/variables'; +@import 'blocks/body'; +@import 'blocks/header'; +@import 'blocks/logo'; +@import 'blocks/nav'; +@import 'blocks/main'; +@import 'blocks/cards'; +@import 'blocks/stars'; diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..50b4cda27e --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,2 @@ +$active-color: #00acdc; +$normal-color: #060b35;