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/readme.md b/readme.md index acd5174814..abad954d5f 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ # Frontend practice with catalog page -Create an HTML page with a catalog. Develop semantic page structure as shown on [the mockup](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=32249%3A354). +Create an HTML page with a catalog. Develop semantic page structure as shown on [the mockup](). - use `Header`, `Stars` and `Card` blocks from previous tasks but rewrite them using BEM and SCSS - remove old `data-qa` attributes @@ -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` @@ -20,6 +20,7 @@ Create an HTML page with a catalog. Develop semantic page structure as shown on - cards container(catalog) have fixed paddings (`50px` vertically and `40px` horizontally) Make all the changes smooth on hover (during 300ms): + - increase the card by 20 percent (neighboring cards **should not be** affected) - change the card title text color to `#34568b` when the card is hovered (`.card:hover .card__title`) - change navigation link text color to `#00acdc` @@ -27,14 +28,15 @@ Make all the changes smooth on hover (during 300ms): > Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline) -*Important note*: In this task, you are allowed to link `*.scss` files directly in HTML `` tags using `href` attribute. +_Important note_: In this task, you are allowed to link `*.scss` files directly in HTML `` tags using `href` attribute. This is possible because [we use the Parcel library](https://en.parceljs.org/scss.html) to bundle your solution's source code. ## 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://ProninaMariia.github.io/layout_catalog/) +- [TEST REPORT LINK](https://ProninaMariia.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..22a2518a39 100644 --- a/src/index.html +++ b/src/index.html @@ -2,26 +2,485 @@ + - Catalog + + Moyo Catalog + + + -

Catalog

+
+ +
+ +
+
+
+ + APPLE A1419 iMac 27 Retina 5K Monoblock + + +

+ 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 + + +

+ 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 + + +

+ 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 + + +

+ 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 + + +

+ 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 + + +

+ 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 + + +

+ 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 + + +

+ 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..8b637d3901 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,261 @@ -body { +$color-nav-default: #060b35; +$color-nav-hover: #00acdc; +$color-active: #00acdc; +$color-title-hover: #34568b; +$color-button-bg: #00acdc; +$color-button-text: #fff; +$color-button-bg-hover: #fff; +$color-button-text-hover: #00acdc; +$card-width: 200px; +$card-gap-x: 48px; +$card-gap-y: 46px; +$catalog-padding-v: 50px; +$catalog-padding-h: 40px; +$transition: 300ms ease; +$bp-2col: 488px; +$bp-3col: 768px; +$bp-4col: 1024px; + +*, +*::before, +*::after { + box-sizing: border-box; margin: 0; + padding: 0; +} + +body { + font-family: Arial, Helvetica, sans-serif; + color: $color-nav-default; +} + +a { + text-decoration: none; + color: inherit; +} + +ul { + list-style: none; +} + +img { + display: block; +} + +.header { + border-bottom: 1px solid #e1e7ed; + background-color: #fff; + + &__inner { + display: flex; + align-items: center; + justify-content: space-between; + padding-inline: 50px; + height: 60px; + } + + &__logo-img { + width: 40px; + height: 40px; + } +} + +.nav { + &__list { + display: flex; + align-items: center; + gap: 20px; + } + + &__link { + position: relative; + display: flex; + align-items: center; + height: 60px; + + font-family: Roboto, sans-serif; + font-size: 12px; + font-weight: 500; + line-height: 60px; + letter-spacing: 0; + text-transform: uppercase; + color: $color-nav-default; + + transition: color $transition; + + &:hover { + color: $color-nav-hover; + } + + &.is-active { + color: $color-active; + + &::after { + content: ''; + + position: absolute; + bottom: 0; + left: 0; + + width: 100%; + height: 4px; + + background-color: $color-active; + border-radius: 8px; + } + } + } +} + +.catalog { + padding: $catalog-padding-v $catalog-padding-h; + + &__grid { + display: grid; + justify-content: center; + align-items: start; + gap: $card-gap-y $card-gap-x; + grid-template-columns: repeat(1, $card-width); + + @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); + } + } +} + +.stars { + display: flex; + gap: 4px; + + &__star { + width: 16px; + height: 16px; + background-image: url('../images/star.svg'); + background-size: contain; + background-repeat: no-repeat; + + &--active { + background-image: url('../images/star-active.svg'); + } + } +} + +.card { + width: $card-width; + padding: 32px 16px 16px; + + border: 1px solid #f3f3f3; + border-radius: 5px; + background-color: #fff; + + transition: transform $transition; + + &:hover { + transform: scale(1.2); + z-index: 1; + } + + &__image-link { + display: flex; + justify-content: center; + margin-bottom: 40px; + } + + &__image { + width: 160px; + height: 134px; + object-fit: contain; + } + + &__title { + margin-bottom: 4px; + + font-size: 12px; + font-weight: 500; + line-height: 18px; + color: $color-nav-default; + + transition: color $transition; + } + + &:hover &__title { + color: $color-title-hover; + } + + &__code { + margin-bottom: 16px; + + font-size: 10px; + line-height: 14px; + color: #616070; + } + + &__rating { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 24px; + } + + &__reviews { + font-size: 10px; + font-weight: 400; + line-height: 14px; + color: $color-nav-default; + } + + &__price { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 16px; + } + + &__price-label { + font-size: 12px; + line-height: 18px; + color: #616070; + } + + &__price-value { + font-size: 16px; + font-weight: 700; + line-height: 18px; + color: $color-nav-default; + } + + &__button { + display: flex; + align-items: center; + justify-content: center; + + height: 40px; + + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-transform: uppercase; + + color: $color-button-text; + background-color: $color-button-bg; + border: 1px solid $color-button-bg; + border-radius: 5px; + + transition: + background-color $transition, + color $transition; + + &:hover { + color: $color-button-text-hover; + background-color: $color-button-bg-hover; + } + } }