diff --git a/readme.md b/readme.md index acd5174814..370800e0a6 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://dmitromurashov-lgtm.github.io/layout_catalog/) +- [TEST REPORT LINK](https://dmitromurashov-lgtm.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/images/Rectangle 4.svg b/src/images/Rectangle 4.svg new file mode 100644 index 0000000000..0b0d19bf5d --- /dev/null +++ b/src/images/Rectangle 4.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/images/imac.jpeg b/src/images/imac.jpeg deleted file mode 100644 index 1f1a90f1dc..0000000000 Binary files a/src/images/imac.jpeg and /dev/null differ diff --git a/src/images/imac.png b/src/images/imac.png new file mode 100644 index 0000000000..2ce1c157cb Binary files /dev/null and b/src/images/imac.png differ diff --git a/src/index.html b/src/index.html index 9cff78eeb7..aebb8e4a17 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,339 @@ -

Catalog

+
+ + + + +
+
+
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
+
+ APPLE A1419 iMac 27" Retina +
+ 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+ +
+ +
+
Price:
+
$2,199
+
+ + + BUY + +
+
+
diff --git a/src/styles/cards.scss b/src/styles/cards.scss new file mode 100644 index 0000000000..1203e6e817 --- /dev/null +++ b/src/styles/cards.scss @@ -0,0 +1,121 @@ +@use 'variables.scss' as *; + +.product-card { + width: 200px; + box-sizing: border-box; + border: 1px solid #f3f3f3; + border-radius: 5px; + transition: transform 300ms ease; + + &__image { + background-image: url(..//images/Rectangle\ 4.svg); + width: 160px; + height: 134px; + line-height: 18px; + background-size: contain; + margin: 32px auto 0; + } + + &__title { + font-family: $font-family; + font-weight: $font-weight-medium; + font-size: $font-size-biger; + margin-top: 40px; + margin-left: 16px; + line-height: 18px; + width: 166px; + height: 36px; + color: #060b35; + transition: color 0.3s ease; + + &:hover { + color: #34568b; + } + } + + &:hover { + color: #34568b; + transform: scale(1.2); + } + + &__code { + font-family: $font-family; + font-weight: $font-weight-regular; + font-size: $font-size; + color: $color-secondary; + margin-top: 4px; + margin-left: 16px; + width: 98px; + height: 14px; + line-height: 14px; + } + + &__reviews { + display: flex; + align-items: end; + gap: 17px; + margin-top: 16px; + margin-left: 16px; + margin-right: 16px; + width: 166px; + height: 16px; + } + &__feedback { + font-family: $font-family; + font-weight: $font-weight-regular; + font-size: $font-size; + color: #060b35; + line-height: 14px; + } + + &__price { + display: flex; + justify-content: space-between; + margin-top: 24px; + margin-left: 16px; + width: 166px; + height: 18px; + + &-label { + font-family: $font-family; + font-weight: $font-weight-regular; + font-size: $font-size-biger; + color: $color-secondary; + line-height: 18px; + } + + &-value { + font-family: $font-family; + font-weight: $font-weight-bold; + font-size: 16px; + line-height: 18px; + color: #060b35; + } + } + + &__button { + border: 1px solid $color-primary; + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + background-color: $color-primary; + border-radius: 5px; + width: 166px; + height: 40px; + text-decoration: none; + color: #fff; + font-family: $font-family; + font-size: 14px; + font-weight: $font-weight-bold; + margin-top: 16px; + margin-left: 16px; + margin-bottom: 16px; + line-height: 16px; + + &:hover { + background-color: #fff; + color: $color-primary; + } + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..5359e448a7 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,79 @@ +@use 'variables.scss' as *; + +:root { + --blue: #00acdc; +} + +body { + margin: 0; +} + +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + background-color: #fff; + box-sizing: border-box; +} + +.logo { + display: block; + width: 40px; + height: 40px; + margin: 0; +} + +.nav-list { + display: flex; + justify-content: flex-end; + margin: 0; + padding: 0; + list-style-type: none; + color: #060b35; +} + +.nav-items { + margin-right: 20px; + + &:last-child { + margin-right: 0; + } +} + +.nav-link { + display: inline-flex; + height: 60px; + align-items: center; + justify-content: center; + text-transform: uppercase; + text-decoration: none; + overflow: visible; + color: #060b35; + font-family: Roboto, sans-serif; + font-weight: 500; + font-size: 12px; + line-height: 100%; + + &--active { + color: $color-primary; + position: relative; + + &::after { + content: ''; + position: absolute; + left: 0; + right: 0; + + height: 4px; + background: var(--blue); + bottom: -8px; + bottom: 0; + border-radius: 8px; + } + } + + &:hover { + color: var(--blue); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..4211c581dc 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,26 @@ body { margin: 0; } + +@media screen and (min-width: 1024px) { + .container { + display: grid; + grid-template-columns: repeat(4, 200px); + padding: 50px 40px; + gap: 46px 48px; + } +} + +@media screen and (min-width: 1200px) { + .container { + display: grid; + grid-template-columns: repeat(4, 200px); + padding: 50px 128px; + gap: 46px 48px; + } +} + +@import 'header'; +@import 'stars'; +@import 'cards'; +@import 'variables'; diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..9252b01403 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,30 @@ +.stars { + display: flex; + + .star { + background-image: url(../images/star.svg); + width: 16px; + height: 16px; + background-position: center; + background-repeat: no-repeat; + + &:not(:last-child) { + margin-right: 4px; + } + } + &--1 .star:nth-child(-n + 1) { + background-image: url(../images/star-active.svg); + } + &--2 .star:nth-child(-n + 2) { + background-image: url(../images/star-active.svg); + } + &--3 .star:nth-child(-n + 3) { + background-image: url(../images/star-active.svg); + } + &--4 .star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } + &--5 .star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); + } +} diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..2f8a145653 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,8 @@ +$font-family: Roboto, sans-serif; +$font-weight-regular: 400; +$font-weight-medium: 500; +$font-weight-bold: 700; +$font-size: 10px; +$font-size-biger: 12px; +$color-primary: #00acdc; +$color-secondary: #616070;