diff --git a/readme.md b/readme.md index cf0977c416..d96c19879d 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` @@ -32,8 +32,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://yurzxw.github.io/layout_catalog/) +- [TEST REPORT LINK](https://yurzxw.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..709c5c9c77 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,372 @@ -

Catalog

+
+ + Moyo + + +
+
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
+ iMac +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + buy + +
+
diff --git a/src/styles/button.scss b/src/styles/button.scss new file mode 100644 index 0000000000..84aa6ec1c4 --- /dev/null +++ b/src/styles/button.scss @@ -0,0 +1,25 @@ +.card__button { + justify-content: center; + box-sizing: border-box; + align-items: center; + text-transform: uppercase; + line-height: 16px; + font-size: 14px; + font-weight: 700; + text-align: center; + width: 166px; + height: 40px; + background-color: #00acdc; + color: $background-color; + text-decoration: none; + border-radius: 5px; + margin: 0 16px 16px; + padding: 12px 70px; + transition: $transition-time; + + &:hover { + background-color: $background-color; + color: var(--hover-color); + border: 1px solid var(--hover-color); + } +} diff --git a/src/styles/catalog.scss b/src/styles/catalog.scss new file mode 100644 index 0000000000..3f377cdfa2 --- /dev/null +++ b/src/styles/catalog.scss @@ -0,0 +1,9 @@ +.catalog { + display: grid; + justify-content: center; + grid-template-rows: repeat(2, 1fr); + row-gap: 46px; + padding: 50px 40px; + + @include on-all; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..2610d0f5b3 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,7 @@ -body { - margin: 0; -} +@import 'utils/variables'; +@import 'moyo_header'; +@import 'utils/mixins'; +@import 'product_card'; +@import 'button'; +@import 'stars'; +@import 'catalog'; diff --git a/src/styles/moyo_header.scss b/src/styles/moyo_header.scss new file mode 100644 index 0000000000..7a00e7491e --- /dev/null +++ b/src/styles/moyo_header.scss @@ -0,0 +1,76 @@ +html { + font-family: Roboto, sans-serif; + font-size: 12px; +} + +body { + margin: 0; +} + +:root { + --hover-color: #00acdc; +} + +.header { + width: 100%; + height: 60px; + font-weight: 500; + line-height: 14.06px; + display: flex; + align-items: center; + justify-content: space-between; +} + +.nav__list { + display: flex; + list-style: none; + padding-left: 0; + margin: 0; +} + +.nav__link { + height: 60px; + line-height: 60px; + + display: flex; + + text-decoration: none; + color: #060b35; + text-transform: uppercase; + margin-right: 20px; + transition: $transition-time; +} + +.nav__link:hover { + color: var(--hover-color); +} + +.moyo { + display: flex; + justify-content: center; + margin-left: 50px; +} + +.is-active { + position: relative; + color: var(--hover-color); +} + +.is-active::after { + content: ''; + position: absolute; + top: 56px; + left: 0; + width: 100%; + height: 4px; + background-color: var(--hover-color); + border-radius: 8px; +} + +.nav { + margin-right: 50px; +} + +.video { + margin-right: 0; +} diff --git a/src/styles/product_card.scss b/src/styles/product_card.scss new file mode 100644 index 0000000000..965da5ba0a --- /dev/null +++ b/src/styles/product_card.scss @@ -0,0 +1,94 @@ +@import 'button'; +@import 'stars'; + +* { + margin: 0; + padding: 0; +} + +body { + margin: 0 auto; + padding: 0; + font-family: $bodyfont; +} + +.card { + display: flex; + flex-direction: column; + border: 1px solid #f3f3f3; + border-radius: 5px; + box-sizing: border-box; + width: 200px; + height: 410px; + grid-column: span 1; + transition: $transition-time; + + &:hover { + transition: $transition-time; + transform: scale(1.2); + } + + &_imac { + width: 160px; + height: 134px; + margin: 32px 19px 40px; + } + + &_name { + color: #060b35; + font-family: $bodyfont; + font-weight: 500; + font-size: 12px; + margin: 0 16px 4px; + line-height: 18px; + transition: $transition-time; + + &:hover { + color: #34568b; + } + } + + &_code { + font-size: 10px; + line-height: 14px; + margin: 0 84px 16px 16px; + color: #616070; + } + + &_reviews { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 16px 24px; + } + + &_comments { + color: #060b35; + margin: 0; + font-size: 10px; + line-height: 14px; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + margin: 0 16px 16px; + } + + &__price-label { + margin: 0; + color: #616070; + font-size: 12px; + font-weight: 400; + line-height: 18px; + } + + &__price-value { + margin: 0; + color: #060b35; + font-size: 16px; + line-height: 18px; + font-weight: 700; + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..e9c50a5d96 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,19 @@ +.stars { + display: flex; +} + +.stars__star { + background-image: url('../images/star.svg'); + background-repeat: no-repeat; + background-position: center; + display: flex; + align-items: center; + justify-content: center; + width: 16px; + height: 16px; + margin-right: 4px; +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); +} diff --git a/src/styles/utils/mixins.scss b/src/styles/utils/mixins.scss new file mode 100644 index 0000000000..75689ef1a3 --- /dev/null +++ b/src/styles/utils/mixins.scss @@ -0,0 +1,21 @@ +@mixin on-all { + @media (min-width: 0) { + grid-template-columns: (1, 200px); + column-gap: 48px; + } + + @media (min-width: 488px) { + grid-template-columns: repeat(2, 200px); + column-gap: 48px; + } + + @media (min-width: 768px) { + grid-template-columns: repeat(3, 200px); + column-gap: 48px; + } + + @media (min-width: 1024px) { + grid-template-columns: repeat(4, 200px); + column-gap: 48px; + } +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..abc1140480 --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,4 @@ +$transition-time: 0.3s; +$bodyfont: Roboto, sans-serif; +$border-radius: 5px; +$background-color: #fff;