diff --git a/package-lock.json b/package-lock.json index 6dd164c6e0..664cd93eb5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@mate-academy/backstop-config": "latest", "@mate-academy/bemlint": "latest", "@mate-academy/linthtml-config": "latest", - "@mate-academy/scripts": "^1.8.6", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/stylelint-config": "latest", "@parcel/transformer-sass": "^2.12.0", "backstopjs": "6.3.23", @@ -1212,10 +1212,11 @@ "dev": true }, "node_modules/@mate-academy/scripts": { - "version": "1.8.6", - "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.8.6.tgz", - "integrity": "sha512-b4om/whj4G9emyi84ORE3FRZzCRwRIesr8tJHXa8EvJdOaAPDpzcJ8A0sFfMsWH9NUOVmOwkBtOXDu5eZZ00Ig==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-2.1.3.tgz", + "integrity": "sha512-a07wHTj/1QUK2Aac5zHad+sGw4rIvcNl5lJmJpAD7OxeSbnCdyI6RXUHwXhjF5MaVo9YHrJ0xVahyERS2IIyBQ==", "dev": true, + "license": "MIT", "dependencies": { "@octokit/rest": "^17.11.2", "@types/get-port": "^4.2.0", diff --git a/package.json b/package.json index 34398805fa..f538e623d5 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@mate-academy/backstop-config": "latest", "@mate-academy/bemlint": "latest", "@mate-academy/linthtml-config": "latest", - "@mate-academy/scripts": "^1.8.6", + "@mate-academy/scripts": "^2.1.3", "@mate-academy/stylelint-config": "latest", "@parcel/transformer-sass": "^2.12.0", "backstopjs": "6.3.23", diff --git a/readme.md b/readme.md index acd5174814..13eeb8d4a0 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://hanna-moskalenko.github.io/layout_catalog/) +- [TEST REPORT LINK](https://hanna-moskalenko.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..44cdbca405 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,8 @@ - + Catalog + + + + - -

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/header.scss b/src/styles/header.scss new file mode 100644 index 0000000000..6fb47b697b --- /dev/null +++ b/src/styles/header.scss @@ -0,0 +1,78 @@ +:root { + --blue-color: #00acdc; +} + +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 500; + font-style: normal; +} + +.head { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + box-sizing: border-box; + background-color: #fff; + + &__logo { + width: 40px; + height: 40px; + display: block; + } + + &__list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + } + + &__item { + margin-right: 20px; + + &:last-child { + margin-right: 0; + } + } + + &__link { + text-transform: uppercase; + position: relative; + display: flex; + align-items: center; + height: 60px; + color: #060b35; + text-decoration: none; + font-size: 12px; + line-height: normal; + letter-spacing: 0; + box-sizing: border-box; + white-space: nowrap; + + transition: color 300ms ease; + + &:hover { + color: var(--blue-color); + } + + &.is-active { + color: var(--blue-color); + + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 4px; + pointer-events: none; + border-radius: 8px; + background-color: var(--blue-color); + } + } + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..569203d28c 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,284 @@ +$color-lite-text: #616070; +$font-weight-700: 700; +$font-weight-500: 500; +$font-weight-400: 400; + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +.page { + font-family: Roboto, sans-serif; +} + +:root { + --blue-color: #00acdc; +} + body { margin: 0; + font-family: Roboto, sans-serif; + font-weight: 500; + font-style: normal; +} + +.head { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px; + box-sizing: border-box; + background-color: #fff; + + &__logo { + width: 40px; + height: 40px; + display: block; + } + + &__list { + display: flex; + list-style: none; + margin: 0; + padding: 0; + } + + &__item { + margin-right: 20px; + + &:last-child { + margin-right: 0; + } + } + + &__link { + text-transform: uppercase; + position: relative; + display: flex; + align-items: center; + height: 60px; + color: #060b35; + text-decoration: none; + font-size: 12px; + line-height: normal; + letter-spacing: 0; + box-sizing: border-box; + white-space: nowrap; + + transition: color 300ms ease; + + &:hover { + color: var(--blue-color); + } + + &.is-active { + color: var(--blue-color); + + &::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + height: 4px; + pointer-events: none; + border-radius: 8px; + background-color: var(--blue-color); + } + } + } +} + +.container { + --column-count: 1; + + display: grid; + grid-template-columns: repeat(var(--column-count), 200px); + padding: 50px 40px; + gap: 46px 48px; + justify-content: center; +} + +@media (min-width: 488px) { + .container { + --column-count: 2; + } +} + +@media (min-width: 768px) { + .container { + --column-count: 3; + } +} + +@media (min-width: 1024px) { + .container { + --column-count: 4; + } +} + +.card { + display: flex; + flex-direction: column; + box-sizing: border-box; + border-radius: 5px; + background-color: #fff; + height: 408px; + width: 200px; + border: 1px solid #f3f3f3; + + transition: transform 300ms ease; + + &:hover { + transform: scale(1.2); + z-index: 10; + } + + &__image { + background-image: url(../images/imac.jpeg); + margin-left: 19px; + margin-top: 32px; + margin-right: 19px; + width: 160px; + height: 134px; + background-size: 160px 134px; + } + + &__title { + margin: 40px 16px 4px; + text-align: left; + width: 166px; + height: 36px; + font-weight: $font-weight-500; + font-size: 12px; + line-height: 18px; + color: #060b35; + + transition: color 300ms ease; + } + + &:hover &__title { + color: #34568b; + } + + &__product-code { + margin: 4px auto 16px 16px; + text-align: left; + min-width: 98px; + min-height: 14px; + font-weight: $font-weight-400; + font-size: 10px; + line-height: 14px; + color: $color-lite-text; + } + + &__rating-block { + display: flex; + justify-content: space-between; + align-items: center; + width: 166px; + height: 16px; + margin-top: 16px; + margin-bottom: 24px; + } + + &__price { + display: flex; + justify-content: space-between; + align-items: center; + width: 166px; + height: 18px; + margin: 24px 16px 15px; + } + + &__price-label { + min-width: 31px; + min-height: 18px; + font-weight: $font-weight-400; + font-size: 12px; + color: $color-lite-text; + } + + &__price-item { + min-width: 50px; + min-height: 18px; + font-weight: $font-weight-700; + font-size: 16px; + line-height: 18px; + color: #060b35; + } + + &__button { + display: flex; + align-items: center; + justify-content: center; + background-color: #00acdc; + border-radius: 5px; + width: 166px; + height: 40px; + margin-left: 16px; + margin-right: 16px; + margin-bottom: 15px; + border: 1px solid transparent; + + color: #fff; + font-weight: $font-weight-700; + font-size: 14px; + line-height: 16px; + cursor: pointer; + font-family: inherit; + + &:hover { + background-color: #fff; + color: #00acdc; + border: 1px solid #00acdc; + } + } +} + +.stars { + display: flex; + align-items: center; + justify-content: space-between; + width: 166px; + height: 16px; + margin-left: 16px; + margin-right: 16px; + + &__items { + display: flex; + gap: 4px; + align-items: center; + } + + &__star { + background-image: url(../images/star.svg); + width: 16px; + height: 16px; + background-position: center; + background-repeat: no-repeat; + border: none; + } + + &--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); + } + + &__reviews { + font-family: Roboto, sans-serif; + display: flex; + height: 16px; + color: #060b35; + font-weight: $font-weight-400; + font-size: 10px; + line-height: 16px; + align-items: center; + } } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..9173741c6e --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,43 @@ +.stars { + display: flex; + align-items: center; + justify-content: space-between; + width: 166px; + height: 16px; + margin-left: 16px; + margin-right: 16px; + + &__items { + display: flex; + gap: 4px; + align-items: center; + } + + &__star { + background-image: url(../images/star.svg); + width: 16px; + height: 16px; + background-position: center; + background-repeat: no-repeat; + border: none; + } + + &--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); + } + + &__reviews { + font-family: Roboto, sans-serif; + display: flex; + height: 16px; + color: #060b35; + font-weight: $font-weight-400; + font-size: 10px; + line-height: 16px; + align-items: center; + } +} diff --git a/src/styles/styles.scss b/src/styles/styles.scss new file mode 100644 index 0000000000..5b2c51512b --- /dev/null +++ b/src/styles/styles.scss @@ -0,0 +1,4 @@ +@import 'variables'; +@import 'header'; +@import 'index'; +@import 'stars'; diff --git a/src/styles/variables.scss b/src/styles/variables.scss new file mode 100644 index 0000000000..759ea1a6d9 --- /dev/null +++ b/src/styles/variables.scss @@ -0,0 +1,4 @@ +$color-lite-text: #616070; +$font-weight-700: 700; +$font-weight-500: 500; +$font-weight-400: 400;