From 9ae26c26d6857f7ea2e152a096d3146530c849a4 Mon Sep 17 00:00:00 2001 From: hannamoskalenko2025 Date: Sun, 31 May 2026 22:48:56 -0500 Subject: [PATCH 1/9] implement responsive grid layout for cards --- readme.md | 6 +- src/index.html | 356 +++++++++++++++++++++++++++++++++++++- src/styles/header.scss | 78 +++++++++ src/styles/index.scss | 155 ++++++++++++++++- src/styles/stars.scss | 43 +++++ src/styles/styles.scss | 4 + src/styles/variables.scss | 4 + 7 files changed, 637 insertions(+), 9 deletions(-) create mode 100644 src/styles/header.scss create mode 100644 src/styles/stars.scss create mode 100644 src/styles/styles.scss create mode 100644 src/styles/variables.scss 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..9f380f3cf9 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..4d6cef7646 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,156 @@ -body { +* { + box-sizing: border-box; margin: 0; + padding: 0; +} + +.page { + font-family: Roboto, sans-serif; +} + +.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; + } + + &__chapter { + 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 &__chapter { + 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; + } + } } 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; From 8e66f406509f1890966932c220ea897519265a08 Mon Sep 17 00:00:00 2001 From: hannamoskalenko2025 Date: Sun, 31 May 2026 23:02:06 -0500 Subject: [PATCH 2/9] fix(catalog): update class names and data-qa attributes for testing --- src/index.html | 23 ++++++++++++++--------- src/styles/index.scss | 4 ++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/index.html b/src/index.html index 9f380f3cf9..44cdbca405 100644 --- a/src/index.html +++ b/src/index.html @@ -135,7 +135,7 @@ >
-

+

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

Product code: 195434

@@ -156,7 +156,12 @@

$2,199

- BUY + + BUY +
$2,199 >
-

+

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

Product code: 195434

@@ -195,7 +200,7 @@

$2,199

>
-

+

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

Product code: 195434

@@ -225,7 +230,7 @@

$2,199

>
-

+

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

Product code: 195434

@@ -255,7 +260,7 @@

$2,199

>
-

+

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

Product code: 195434

@@ -285,7 +290,7 @@

$2,199

>
-

+

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

Product code: 195434

@@ -315,7 +320,7 @@

$2,199

>
-

+

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

Product code: 195434

@@ -345,7 +350,7 @@

$2,199

>
-

+

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

Product code: 195434

diff --git a/src/styles/index.scss b/src/styles/index.scss index 4d6cef7646..c1cadc7f65 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -63,7 +63,7 @@ background-size: 160px 134px; } - &__chapter { + &__title { margin: 40px 16px 4px; text-align: left; width: 166px; @@ -76,7 +76,7 @@ transition: color 300ms ease; } - &:hover &__chapter { + &:hover &__title { color: #34568b; } From 36f359aadfcad463870115676c2bc886dc8dc36f Mon Sep 17 00:00:00 2001 From: hannamoskalenko2025 Date: Mon, 1 Jun 2026 16:54:30 -0500 Subject: [PATCH 3/9] fixed: link to styles --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 44cdbca405..3d4f3fa7e4 100644 --- a/src/index.html +++ b/src/index.html @@ -25,7 +25,7 @@ /> Date: Mon, 1 Jun 2026 16:57:10 -0500 Subject: [PATCH 4/9] fixed link to css --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 3d4f3fa7e4..44cdbca405 100644 --- a/src/index.html +++ b/src/index.html @@ -25,7 +25,7 @@ /> Date: Mon, 1 Jun 2026 17:15:54 -0500 Subject: [PATCH 5/9] fixed link --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 44cdbca405..8fc34ee9b3 100644 --- a/src/index.html +++ b/src/index.html @@ -25,7 +25,7 @@ /> Date: Mon, 1 Jun 2026 18:58:16 -0500 Subject: [PATCH 6/9] parcel running --- src/index.html | 5 +- src/styles/index.scss | 130 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index 8fc34ee9b3..3896aaf582 100644 --- a/src/index.html +++ b/src/index.html @@ -23,10 +23,7 @@ href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet" /> - + Date: Mon, 1 Jun 2026 19:08:17 -0500 Subject: [PATCH 7/9] build parcel --- .github/workflows/test.yml-template | 29 +++++++ package-lock.json | 9 +- package.json | 2 +- src/index.html | 5 +- src/styles/index.scss | 130 ++++++++++++++++++++++++++++ 5 files changed, 166 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test.yml-template diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 0000000000..8b5743ecb4 --- /dev/null +++ b/.github/workflows/test.yml-template @@ -0,0 +1,29 @@ +name: Test + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + - name: Upload HTML report(backstop data) + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: report + path: backstop_data 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/src/index.html b/src/index.html index 8fc34ee9b3..3896aaf582 100644 --- a/src/index.html +++ b/src/index.html @@ -23,10 +23,7 @@ href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet" /> - + Date: Mon, 1 Jun 2026 19:13:57 -0500 Subject: [PATCH 8/9] remove workflow file --- .github/workflows/test.yml-template | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/test.yml-template diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template deleted file mode 100644 index 8b5743ecb4..0000000000 --- a/.github/workflows/test.yml-template +++ /dev/null @@ -1,29 +0,0 @@ -name: Test - -on: - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.x] - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test - - name: Upload HTML report(backstop data) - if: ${{ always() }} - uses: actions/upload-artifact@v2 - with: - name: report - path: backstop_data From ca081b12fb2f2519be9630ab5e9933ca0a42dbfe Mon Sep 17 00:00:00 2001 From: hannamoskalenko2025 Date: Mon, 1 Jun 2026 19:24:43 -0500 Subject: [PATCH 9/9] removed parcel --- src/index.html | 5 ++++- src/styles/index.scss | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index 3896aaf582..44cdbca405 100644 --- a/src/index.html +++ b/src/index.html @@ -23,7 +23,10 @@ href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet" /> - +