diff --git a/readme.md b/readme.md index 874ca70d97..4ac723d580 100644 --- a/readme.md +++ b/readme.md @@ -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` @@ -33,8 +33,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ## 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://Liudmila333.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Liudmila333.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..0cf54fc4ab 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,366 @@ -

Catalog

+
+ + moyo-logo + + + +
+ +
+
+ APPLE A1419 iMac 27 + +

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

+ +

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+ +

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+ +

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+ +

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+ APPLE A1419 iMac 27 + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+ +
+ APPLE A1419 iMac 27 + +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..70d0e9a063 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,91 @@ +.product-card { + padding: 32px 16px 16px; + width: $card-width; + border: 1px solid #f3f3f3; + border-radius: $border-radius; + transition: all 0.2s; + + &:hover { + transform: scale(1.1); + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + } + + &__image { + display: block; + margin: 0 auto 40px; + width: 160px; + height: 134px; + } + + &__name { + font-size: 12px; + font-weight: 500; + margin-bottom: 4px; + transition: color 0.2s; + color: $main-accent-color; + } + + &:hover &__name { + color: #34568b; + } + + &__code { + font-size: 10px; + line-height: 14px; + margin-bottom: 16px; + color: $secondary-color; + } + + &__info { + margin-bottom: 24px; + + @include flex-center; + } + + &__review { + font-size: 10px; + line-height: 14px; + color: $main-accent-color; + } + + &__price { + margin-bottom: 16px; + color: $secondary-color; + + @include flex-center; + + &-title { + font-size: 12px; + } + + &-value { + font-size: 16px; + font-weight: 700; + color: $main-accent-color; + } + } + + &__buy { + display: inline-block; + height: 40px; + width: 100%; + + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-transform: uppercase; + text-decoration: none; + text-align: center; + color: #fff; + padding: 12px 70px; + background-color: $blue-accent-color; + border: $button-border; + border-radius: $border-radius; + + &:hover { + background-color: #fff; + color: $blue-accent-color; + border: $button-border; + } + } +} diff --git a/src/styles/blocks/catalog.scss b/src/styles/blocks/catalog.scss new file mode 100644 index 0000000000..79b5035c4c --- /dev/null +++ b/src/styles/blocks/catalog.scss @@ -0,0 +1,11 @@ +.catalog { + display: grid; + grid-template-columns: repeat(1, 200px); + gap: 46px 48px; + padding: 50px 40px; + justify-content: center; + + @include responsive-columns(488px, 2); + @include responsive-columns(768px, 3); + @include responsive-columns(1024px, 4); +} diff --git a/src/styles/blocks/header.scss b/src/styles/blocks/header.scss new file mode 100644 index 0000000000..14b62a324f --- /dev/null +++ b/src/styles/blocks/header.scss @@ -0,0 +1,65 @@ +body { + margin: 0; + padding: 0; +} + +.header { + font-size: 12px; + font-weight: 500; + width: 100%; + padding: 0 50px; + box-shadow: 0 2px 4px #0000000d; + + @include flex-center; +} + +.header__img { + width: 40px; + height: 40px; + + img { + width: 100%; + } +} + +.header__list { + display: flex; + margin: 0; + padding: 0; + list-style: none; + flex-wrap: wrap; +} + +.header__item { + display: flex; + align-items: center; + justify-content: center; + height: 60px; + + &:not(:last-child) { + margin-right: 20px; + } +} + +.header__link { + padding: 22px 0; + + @include link-style($main-accent-color); +} + +.is-active { + position: relative; + color: $blue-accent-color; + padding: 23px 0; + + &::after { + content: ''; + background-color: $blue-accent-color; + width: 100%; + height: 4px; + border-radius: 8px; + position: absolute; + bottom: 2px; + left: 0; + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..595eaa8841 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,23 @@ +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: center; + background-image: url(../images/star.svg); + } + + &__star:not(:last-child) { + margin-right: 4px; + } + + &--1 .stars__star:nth-child(-n + 1), + &--2 .stars__star:nth-child(-n + 2), + &--3 .stars__star:nth-child(-n + 3), + &--4 .stars__star:nth-child(-n + 4), + &--5 .stars__star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..3427d0a773 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,7 @@ -body { - margin: 0; -} +@import './utils/normalize'; +@import './utils/variables'; +@import './utils/mixins'; +@import './blocks/catalog'; +@import './blocks/header'; +@import './blocks/stars'; +@import './blocks/card'; diff --git a/src/styles/utils/mixins.scss b/src/styles/utils/mixins.scss new file mode 100644 index 0000000000..cb1ddd449d --- /dev/null +++ b/src/styles/utils/mixins.scss @@ -0,0 +1,22 @@ +@mixin flex-center() { + display: flex; + justify-content: space-between; + align-items: center; +} + +@mixin responsive-columns($min-width, $columns) { + @media (min-width: $min-width) { + grid-template-columns: repeat($columns, 200px); + } +} + +@mixin link-style($color, $hover-color: $blue-accent-color) { + text-transform: uppercase; + text-decoration: none; + color: $color; + transition: color 0.3s ease; + + &:hover { + color: $hover-color; + } +} diff --git a/src/styles/utils/normalize.scss b/src/styles/utils/normalize.scss new file mode 100644 index 0000000000..f8bcedbd65 --- /dev/null +++ b/src/styles/utils/normalize.scss @@ -0,0 +1,9 @@ +* { + box-sizing: border-box; + margin: 0; +} + +html { + font-family: Roboto, Arial, sans-serif; + line-height: 18px; +} diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..d7c1c48d6b --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,6 @@ +$card-width: 200px; +$main-accent-color: #060b35; +$blue-accent-color: #00acdc; +$secondary-color: #616070; +$border-radius: 5px; +$button-border: 1px solid $blue-accent-color;