diff --git a/readme.md b/readme.md index 705275c4af..88caef3777 100644 --- a/readme.md +++ b/readme.md @@ -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` @@ -30,8 +30,8 @@ Make all the changes smooth on hover (during 300ms): ## 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://OlehPhw.github.io/layout_catalog/) +- [TEST REPORT LINK](https://OlehPhw.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..4ff3a5b077 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,409 @@ -

Catalog

+
+ + moyo + + +
+
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
+ imac-logo + +

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

+ +

Product code: 195434

+ +
+
+
+
+
+
+
+
+

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + + Buy + +
+
diff --git a/src/styles/card.scss b/src/styles/card.scss new file mode 100644 index 0000000000..e69264ab23 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,104 @@ +.card { + margin: 0; + padding: 32px 16px 16px; + width: $card-width; + border: 1px solid #f3f3f3; + border-radius: 5px; + display: flex; + flex-direction: column; + align-items: center; + transition: transform 300ms linear; + + &__image { + width: 100%; + height: 134px; + object-fit: contain; + } + + &__name-panel { + width: 100%; + height: 36px; + font-size: $medium-font; + font-weight: $standart-font-weight; + line-height: 18px; + margin-top: 40px; + color: $color-main; + margin-bottom: 4px; + } + + &:hover { + transform: scale(1.2); + + .card__name-panel { + color: #34568b; + } + } + + &__product-code { + width: 100%; + height: 14px; + font-size: $small-font; + font-weight: $small-font-weight; + color: $color-secondary; + align-self: flex-start; + margin-bottom: 16px; + } + + &__review { + width: 100%; + height: 16px; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + font-size: $small-font; + color: $color-main; + margin-bottom: 24px; + font-weight: $small-font-weight; + } + + &__price-panel { + width: 100%; + height: 18px; + display: flex; + justify-content: space-between; + align-items: center; + line-height: 18px; + margin-bottom: 16px; + + &-text { + font-size: $medium-font; + color: $color-secondary; + font-weight: $small-font-weight; + } + + &-value { + font-weight: $big-font-weight; + font-size: 16px; + color: $color-main; + } + } + + &__button { + width: 100%; + height: 40px; + background-color: $button-color; + text-decoration: none; + border: 1px solid $button-color; + border-radius: 5px; + display: flex; + justify-content: center; + align-items: center; + font-weight: $big-font-weight; + font-size: 14px; + text-align: center; + color: #fff; + text-transform: uppercase; + transition: background-color 300ms linear; + + &:hover { + background-color: #fff; + color: $button-color; + } + } +} diff --git a/src/styles/container.scss b/src/styles/container.scss new file mode 100644 index 0000000000..733201850a --- /dev/null +++ b/src/styles/container.scss @@ -0,0 +1,29 @@ +.container { + --column-count: 1; + + display: grid; + grid-template-rows: 1fr 1fr; + grid-template-columns: repeat(var(--column-count), 200px); + grid-gap: 46px 48px; + place-content: center; + + padding: 50px 40px; +} + +@media (min-width: 488px) { + .container { + --column-count: 2; + } +} + +@media (min-width: 768px) { + .container { + --column-count: 3; + } +} + +@media (min-width: 1024px) { + .container { + --column-count: 4; + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..8e56486c97 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,11 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 50px; + + &__img { + width: 40px; + height: 40px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..388b2bbca2 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,21 @@ -body { +@import './variables'; +@import './stars'; +@import './card'; +@import './header'; +@import './container'; +@import './nav'; + +html { + font-family: Roboto, sans-serif; +} + +* { + box-sizing: border-box; margin: 0; + padding: 0; +} + +body { + font-weight: $standart-font-weight; + font-size: 12px; } diff --git a/src/styles/nav.scss b/src/styles/nav.scss new file mode 100644 index 0000000000..cf7b5dfa3f --- /dev/null +++ b/src/styles/nav.scss @@ -0,0 +1,55 @@ +.nav { + justify-content: center; + align-items: center; + + &__list { + list-style: none; + text-align: right; + width: 100%; + display: flex; + flex-direction: row; + } + + &__link { + text-decoration: none; + color: #060b35; + text-transform: uppercase; + height: 60px; + align-items: center; + display: flex; + transition: color 300ms linear; + + &:hover { + color: $button-color; + } + } + + &__item { + margin-left: 20px; + + &:first-child { + margin-left: 0; + } + } +} + +a:active { + color: $button-color; +} + +.is-active { + position: relative; + text-decoration: none; + color: $button-color; +} + +.is-active::after { + position: absolute; + content: ''; + bottom: 0; + left: 0; + width: 100%; + height: 4px; + background-color: $button-color; + border-radius: 8px; +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..20490c8402 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,22 @@ +.stars { + display: flex; + flex-direction: row; + width: 96px; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center center; + width: $star-size; + height: $star-size; + margin-right: 4px; + } +} + +.stars--5 .stars__star, +.stars--1 .stars__star:nth-child(-n + 1), +.stars--2 .stars__star:nth-child(-n + 2), +.stars--3 .stars__star:nth-child(-n + 3), +.stars--4 .stars__star:nth-child(-n + 4) { + 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..aacee5f86e --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,10 @@ +$color-main: #060b35; +$color-secondary: #616070; +$button-color: #00acdc; +$card-width: 200px; +$small-font: 10px; +$medium-font: 12px; +$small-font-weight: 400; +$big-font-weight: 700; +$standart-font-weight: 500; +$star-size: 16px;