diff --git a/readme.md b/readme.md index acd5174814..a3d3e74903 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://Slappy228.github.io/layout_catalog/) +- [TEST REPORT LINK](https://Slappy228.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..152efaf3cc 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,362 @@ -

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..70c217f5b6 --- /dev/null +++ b/src/styles/card.scss @@ -0,0 +1,114 @@ +.card { + width: $card-width; + padding: 32px 16px 16px; + border: 1px solid #f3f3f3; + border-radius: 5px; + display: flex; + flex-direction: column; + transition: transform 0.3s; + + &:hover { + transform: scale(1.2); + } + + &__image { + background-image: url(../images/imac.jpeg); + width: 160px; + height: 134px; + background-size: 100% 100%; + background-repeat: no-repeat; + background-position: center; + margin: 0 auto 40px; + } + + &__description { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + } + + &__title { + font-size: 12px; + font-weight: 500; + line-height: 18px; + letter-spacing: 0; + color: $color-primary; + } + + &:hover &__title { + color: #34568b; + } + + &__code { + font-size: 10px; + font-weight: 400; + line-height: 14px; + letter-spacing: 0; + color: $color-secondary; + margin: 0; + padding-top: 4px; + align-self: self-start; + } + + &__review { + display: flex; + align-items: flex-end; + justify-content: space-between; + padding: 16px 0 24px; + } + + &__review-text { + font-size: 10px; + font-weight: 400; + line-height: 14px; + letter-spacing: 0; + color: $color-primary; + } + + &__price-box { + display: flex; + justify-content: space-between; + padding-bottom: 16px; + } + + &__price-label { + font-size: 12px; + font-weight: 400; + line-height: 18px; + letter-spacing: 0; + color: $color-secondary; + } + + &__price-value { + font-size: 16px; + font-weight: 700; + line-height: 18px; + letter-spacing: 0; + color: $color-primary; + } + + &__buy-btn { + display: block; + text-decoration: none; + text-align: center; + line-height: 38px; + width: 166px; + height: 40px; + border-radius: 5px; + background-color: $color-accent; + color: $color-white; + font-size: 14px; + font-weight: 700; + text-transform: uppercase; + margin: 0 auto; + border: 1px solid transparent; + transition: background-color 0.3s ease; + } + + &__buy-btn:hover { + background-color: $color-white; + color: $color-accent; + border-color: $color-accent; + } +} diff --git a/src/styles/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..84ab51bf3f --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,62 @@ +.header { + display: flex; + align-items: center; + justify-content: space-between; + padding-left: 50px; + padding-right: 50px; + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); + + &__logo { + text-decoration: none; + height: 40px; + } + + &__list { + display: flex; + flex-wrap: wrap; + list-style-type: none; + justify-content: flex-start; + margin: 0; + padding: 0; + text-transform: uppercase; + } + + &__item { + height: 60px; + } + + &__item + &__item { + margin-left: 20px; + } + + &__link { + display: flex; + position: relative; + align-items: center; + text-decoration: none; + color: $color-primary; + height: 100%; + transition: color 0.3s ease; + } + + &__link:hover { + color: $color-accent; + } + + &__link--is-active { + color: $color-accent; + } + + &__link--is-active::after { + content: ''; + position: absolute; + bottom: 0; + width: 100%; + height: 4px; + background-color: $color-accent; + border-radius: 2px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..81ead128f1 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,12 @@ -body { +@import 'variables'; +@import 'card'; +@import 'stars'; +@import 'header'; +@import 'main'; + +* { + box-sizing: border-box; margin: 0; + padding: 0; + font-family: $font-main; } diff --git a/src/styles/main.scss b/src/styles/main.scss new file mode 100644 index 0000000000..55bc4c148a --- /dev/null +++ b/src/styles/main.scss @@ -0,0 +1,26 @@ +.main { + padding: 50px 40px; + + display: grid; + grid-template-columns: repeat(1, $card-width); + gap: 46px 48px; + justify-content: center; +} + +@media (min-width: 488px) { + .main { + grid-template-columns: repeat(2, $card-width); + } +} + +@media (min-width: 768px) { + .main { + grid-template-columns: repeat(3, $card-width); + } +} + +@media (min-width: 1024px) { + .main { + grid-template-columns: repeat(4, $card-width); + } +} diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..4cb0a57431 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,32 @@ +.stars { + display: flex; + gap: 4px; + + &__star { + width: 16px; + height: 16px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + } + + &--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..281f2f0071 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,6 @@ +$color-primary: #060b35; +$color-secondary: #616070; +$color-accent: #00acdc; +$color-white: #fff; +$font-main: 'Roboto', sans-serif; +$card-width: 200px;