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..a4fbd249d3 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,9 +1212,9 @@ "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, "dependencies": { "@octokit/rest": "^17.11.2", 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..584a02187b 100644 --- a/readme.md +++ b/readme.md @@ -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://ahromovyi.github.io/layout_catalog/) +- [TEST REPORT LINK](https://ahromovyi.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..89d9b8ab2e 100644 --- a/src/index.html +++ b/src/index.html @@ -9,7 +9,7 @@ Catalog - -

Catalog

+
+ + + +
+ +
+ +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+ + +
+ iMac A1419 +

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

+

Product code: 195434

+
+
+
+
+
+
+
+
+

Reviews: 5

+
+

+ Price: + $2,199 +

+ + Buy + +
+
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..626c34ca26 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,259 @@ +// ─── Variables ──────────────────────────────────────────────────────────── +$color-main: #00acdc; +$color-bg: #fff; +$color-text-accent: #060b35; +$color-text-secondary: #616070; +$color-nav-text: #060b35; +$color-nav-hover: #00acdc; +$color-title-hover: #34568b; +$color-border: #f3f3f3; +$card-width: 200px; +$gap-h: 48px; +$gap-v: 46px; +$catalog-padding-v: 50px; +$catalog-padding-h: 40px; +$transition: 300ms ease; +$bp-2col: 488px; +$bp-3col: 768px; +$bp-4col: 1024px; + +// ─── Reset & Base ───────────────────────────────────────────────────────── +* { + box-sizing: border-box; +} + body { + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; margin: 0; } + +// ─── Logo ───────────────────────────────────────────────────────────────── +.logo { + display: block; + height: 40px; + width: 40px; + flex-shrink: 0; + + &__image { + height: 100%; + width: 100%; + } +} + +// ─── Header ─────────────────────────────────────────────────────────────── +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 50px; + background: $color-bg; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); +} + +// ─── Nav ────────────────────────────────────────────────────────────────── +.nav { + &__list { + display: flex; + padding: 0; + margin: 0; + list-style: none; + } + + &__item { + margin-left: 20px; + + &:first-child { + margin-left: 0; + } + } + + &__link { + position: relative; + display: flex; + align-items: center; + height: 60px; + white-space: nowrap; + text-decoration: none; + text-transform: uppercase; + color: $color-nav-text; + transition: color $transition; + + &:hover { + color: $color-nav-hover; + } + + &.is-active { + color: $color-nav-hover; + + &::after { + content: ''; + position: absolute; + background-color: $color-nav-hover; + bottom: 0; + left: 0; + right: 0; + height: 4px; + border-radius: 2px; + } + } + } +} + +// ─── Catalog (main grid) ────────────────────────────────────────────────── +.catalog { + padding: $catalog-padding-v $catalog-padding-h; + display: grid; + grid-template-columns: repeat(1, $card-width); + gap: $gap-v $gap-h; + justify-content: center; + + @media (min-width: $bp-2col) { + grid-template-columns: repeat(2, $card-width); + } + + @media (min-width: $bp-3col) { + grid-template-columns: repeat(3, $card-width); + } + + @media (min-width: $bp-4col) { + grid-template-columns: repeat(4, $card-width); + } +} + +// ─── Card ───────────────────────────────────────────────────────────────── +.card { + box-sizing: border-box; + width: $card-width; + border: 1px solid $color-border; + border-radius: 5px; + padding: 32px 16px 16px; + background: $color-bg; + position: relative; + z-index: 1; + transition: transform $transition; + + &:hover { + transform: scale(1.2); + z-index: 10; + } + + &__image { + display: block; + margin: 0 auto 40px; + width: 160px; + height: 134px; + } + + &__title { + margin: 0 0 4px; + font-size: 12px; + line-height: 18px; + font-weight: 500; + color: $color-text-accent; + transition: color $transition; + + .card:hover & { + color: $color-title-hover; + } + } + + &__code { + margin-top: 4px; + margin-bottom: 14px; + color: $color-text-secondary; + font-size: 10px; + } + + &__review-container { + display: flex; + justify-content: space-between; + align-items: flex-end; + margin-bottom: 24px; + } + + &__review-count { + color: $color-text-accent; + margin-bottom: 0; + font-size: 10px; + } + + &__price-container { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 10px; + margin-bottom: 16px; + } + + &__price-label { + font-size: 12px; + line-height: 18px; + color: $color-text-secondary; + font-weight: 400; + } + + &__price { + font-size: 16px; + line-height: 18px; + font-weight: bold; + color: $color-text-accent; + } + + &__buy { + display: flex; + justify-content: center; + align-items: center; + box-sizing: border-box; + height: 40px; + border: 1px solid $color-main; + border-radius: 5px; + font-size: 14px; + line-height: 16px; + font-weight: 700; + text-decoration: none; + text-transform: uppercase; + color: $color-bg; + background-color: $color-main; + transition: + color $transition, + background-color $transition; + + &:hover { + color: $color-main; + background-color: $color-bg; + } + + .card:hover & { + color: $color-main; + background-color: $color-bg; + } + } +} + +// ─── Stars ──────────────────────────────────────────────────────────────── +.stars { + display: flex; + + &__star { + width: 16px; + height: 16px; + margin-right: 4px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + + &:last-child { + margin-right: 0; + } + } + + &--1 &__star:nth-child(-n + 1), + &--2 &__star:nth-child(-n + 2), + &--3 &__star:nth-child(-n + 3), + &--4 &__star:nth-child(-n + 4), + &--5 &__star:nth-child(-n + 5) { + background-image: url(../images/star-active.svg); + } +}