diff --git a/readme.md b/readme.md index acd5174814..74875cd997 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://NureSviderskyiOleksandr.github.io/layout_catalog/) +- [TEST REPORT LINK](https://NureSviderskyiOleksandr.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..76fa11174d 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,312 @@ -

Catalog

+ +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+

Reviews: 5

+
+
+

Price:

+

$2,199

+
+ + Buy + +
+
+
+
+ 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..531d668eac --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,96 @@ +.card { + position: relative; + display: flex; + flex-direction: column; + box-sizing: border-box; + width: 200px; + border: 1px solid $border-color; + border-radius: 5px; + padding: 16px; + align-items: center; + font-family: $card-font-family; + + &__image { + background-image: url('../images/imac.jpeg'); + background-size: 160px 134px; + background-position: center; + margin-top: 16px; + margin-bottom: 40px; + width: 160px; + height: 134px; + } + + &__title { + font-size: 12px; + line-height: 18px; + font-weight: 500; + margin-bottom: 4px; + color: $main-color; + } + + &__code { + align-self: flex-start; + font-size: 10px; + line-height: 14px; + color: $sub-color; + font-weight: 400; + margin-bottom: 16px; + } + + &__rating { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 24px; + } + + &__count { + font-weight: 400; + font-size: 10px; + color: $main-color; + margin: 0; + } + + &__price { + width: 100%; + display: flex; + justify-content: space-between; + align-items: center; + } + + &__price-value { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: $main-color; + margin: 0; + } + + &__price-label { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: $sub-color; + margin: 0; + } + + &__button { + margin-top: 16px; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + width: 166px; + height: 40px; + background-color: $blue-color; + border-radius: 5px; + + font-weight: 700; + font-size: 14px; + line-height: 16px; + color: #fff; + text-transform: uppercase; + text-decoration: none; + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..b9bc893b84 --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,63 @@ +.menu-container { + display: flex; + height: $header-height; + padding: 0 50px; + color: #060b35; + box-shadow: 0 2px 4px 0 #0000000d; + + text-transform: uppercase; + + justify-content: space-between; + align-items: center; +} + +.nav-list { + display: flex; + list-style: none; + margin: 0; + padding: 0; +} + +.logo { + width: 40px; + height: 40px; +} + +.nav-list__nav-link { + display: flex; + position: relative; + align-items: center; + height: $header-height; + text-decoration: none; + color: $main-color; + font-size: 12px; + margin-right: 20px; +} + +.nav-list__nav-link:hover { + transition: 300ms; + color: $blue-color; +} + +.nav-list__nav-link:focus { + color: $blue-color; +} + +li:last-child .nav-list__nav-link { + margin-right: 0; +} + +.is-active::after { + content: ''; + position: absolute; + display: block; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: $blue-color; + bottom: 0; +} + +.is-active { + color: $blue-color; +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..99f2d6deef 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,39 @@ +@import './variables'; +@import './mixins'; +@import './header'; +@import './card'; +@import './stars'; + body { margin: 0; + font-family: Roboto, sans-serif; + font-weight: 500; +} + +.container { + display: grid; + padding: 50px 40px; + gap: 46px 48px; + justify-content: center; + + @include grid-card-scale; +} + +.card { + transition: 300ms; + + &:hover { + transform: scale(1.2); + + .card__title { + transition: 300ms; + color: #34568b; + } + + .card__button { + transition: 300ms; + background-color: #fff; + color: $blue-color; + } + } } diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss new file mode 100644 index 0000000000..74b33f3035 --- /dev/null +++ b/src/styles/mixins.scss @@ -0,0 +1,15 @@ +@mixin grid-card-scale { + grid-template-columns: repeat(1, 200px); + + @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/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..30cd23b714 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,21 @@ +.stars { + display: flex; + align-items: center; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + width: 16px; + height: 16px; + 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/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..767bdbc844 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,6 @@ +$main-color: #060b35; +$sub-color: #616070; +$border-color: #f3f3f3; +$header-height: 60px; +$blue-color: #00acdc; +$card-font-family: Roboto, sans-serif;