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..c9d205a795 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": "^1.9.12", "@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": "1.9.12", + "resolved": "https://registry.npmjs.org/@mate-academy/scripts/-/scripts-1.9.12.tgz", + "integrity": "sha512-/OcmxMa34lYLFlGx7Ig926W1U1qjrnXbjFJ2TzUcDaLmED+A5se652NcWwGOidXRuMAOYLPU2jNYBEkKyXrFJA==", "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..e25ee5cdde 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": "^1.9.12", "@mate-academy/stylelint-config": "latest", "@parcel/transformer-sass": "^2.12.0", "backstopjs": "6.3.23", diff --git a/readme.md b/readme.md index 874ca70d97..a460acc272 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://ValentynaD.github.io/layout_catalog/) +- [TEST REPORT LINK](https://ValentynaD.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..679acb31f0 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,483 @@ -

Catalog

+
+ + +
+
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+ iMac +

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

+
Product code: 195434
+
+
+ + + + + +
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
diff --git a/src/styles/box/card.scss b/src/styles/box/card.scss new file mode 100644 index 0000000000..03f9b395d8 --- /dev/null +++ b/src/styles/box/card.scss @@ -0,0 +1,168 @@ +.catalog { + display: grid; + grid-template-rows: 408px; + grid-template-columns: 200px; + padding: 50px 40px; + gap: 46px 48px; + + @media screen and (min-width: 488px) { + grid-template-columns: repeat(2, 1fr); + } + + @media screen and (min-width: 768px) { + grid-template-columns: repeat(3, 1fr); + } + + @media screen and (min-width: 1024px) { + grid-template-columns: repeat(4, 1fr); + } + + @media (min-width: 1200px) { + grid-template-columns: repeat(4, 1fr); + padding-left: 128px; + padding-right: 128px; + } +} + +.product-card { + box-sizing: border-box; + width: $card-width; + height: 412px; + display: flex; + align-items: center; + flex-flow: column wrap; + border: 1px solid #f3f3f3; + border-radius: 5px; + background-color: #fff; + text-align: center; + margin: 0; + padding: 32px 0 7px; + + &__bg { + width: 160px; + height: 134px; + margin: 0 auto; + margin-bottom: 40px; + padding: 0 19px; + } + + &__title { + width: 166px; + font-size: 12px; + font-weight: 500; + line-height: 18px; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #060b35; + margin: 0; + } + + &__title:hover { + color: #34568b; + } + + &__code { + font-size: 10px; + font-weight: 400; + line-height: 14px; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #616070; + margin-top: 4px; + margin-bottom: 0; + margin-right: 68px; + } + + &__rating { + width: 169px; + display: flex; + justify-content: space-between; + align-items: center; + margin: 16px 0 2px 3px; + font-family: Roboto, sans-serif; + font-size: 10px; + font-weight: 400; + line-height: 14px; + text-align: right; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #060b35; + } + + &__reviews { + width: 52px; + display: flex; + box-sizing: border-box; + text-align: right; + padding-top: 1px; + padding-bottom: 0; + padding-left: 2px; + margin-left: 16px; + } + + &__price { + width: 166px; + display: flex; + justify-content: space-between; + margin-top: 21px; + margin-bottom: 15px; + + &-title { + font-size: 12px; + font-weight: 400; + line-height: 18px; + text-align: left; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #616070; + margin-bottom: 0; + padding-top: 2px; + } + + &-sum { + box-sizing: border-box; + font-size: 16px; + font-weight: 700; + line-height: 18px; + text-align: right; + text-align: end; + text-underline-position: from-font; + text-decoration-skip-ink: none; + color: #060b35; + padding-top: 2px; + } + } + + &__link { + display: flex; + align-items: center; + justify-content: center; + width: 166px; + height: 40px; + border-style: none; + border-radius: 5px; + margin: 0 auto; + color: #fff; + text-decoration: none; + background-color: #00acdc; + font-family: Roboto, sans-serif; + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-align: center; + text-underline-position: from-font; + text-decoration-skip-ink: none; + text-transform: uppercase; + + &:hover { + color: #00acdc; + background-color: #fff; + border: 1px solid #00acdc; + transition: + background-color 0.3s, + color 0.3s; + } + } +} diff --git a/src/styles/box/header.scss b/src/styles/box/header.scss new file mode 100644 index 0000000000..03a2dca8d9 --- /dev/null +++ b/src/styles/box/header.scss @@ -0,0 +1,102 @@ +.header { + position: relative; + width: 1024px; + height: 60px; + display: flex; + justify-content: space-between; + align-items: center; + margin: 0; + + &::after { + content: ''; + position: absolute; + bottom: 6px; + left: 0; + right: 0; + height: 2px; + background-color: #fff; + box-shadow: 0 2px 4px 0 #0000000d; + z-index: -1; + } + + &__logo { + height: 60px; + display: flex; + align-items: center; + margin-left: 50px; + padding-top: 2px; + + &-img { + height: 40px; + margin: 0; + } + } + + &__nav { + height: 100%; + display: flex; + align-items: center; + margin-right: 50px; + + &-list { + display: flex; + list-style: none; + align-items: center; + gap: 20px; + padding: 0; + } + + &-item { + height: 60px; + display: flex; + align-items: center; + + &:first-child { + margin-left: 0; + margin-top: 0; + } + + &:last-child { + margin-right: 0; + } + } + + &-link { + height: 100%; + display: flex; + align-items: center; + color: #060b35; + text-decoration: none; + font-family: Roboto, sans-serif; + font-weight: 500; + font-size: 12px; + + &:hover { + color: #00acdc; + } + + &.is-active { + color: #00acdc; + text-transform: uppercase; + position: relative; + + &::after { + content: ''; + display: block; + width: 37px; + height: 4px; + background-color: #00acdc; + border-radius: 8px; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + } + } + } + } + + @media (min-width: 1200px) { + width: 1200px; + } +} diff --git a/src/styles/box/stars.scss b/src/styles/box/stars.scss new file mode 100644 index 0000000000..41158f8a49 --- /dev/null +++ b/src/styles/box/stars.scss @@ -0,0 +1,31 @@ +.product-card__stars { + width: 100px; + display: flex; + height: $star-height; + align-items: center; + justify-content: left; + list-style: none; + padding: 0; + margin: 0 auto; +} + +.product-card__star { + display: flex; + background-image: $star-bg; + background-size: contain; + background-repeat: no-repeat; + background-position: center; + box-sizing: border-box; + width: $star-width; + height: $star-height; + padding: 0; + margin-right: 6px; + margin-left: 1px; +} + +.product-card__star:nth-child(-n + 4) { + background-image: $star-active-bg; + background-size: contain; + background-repeat: no-repeat; + background-position: center; +} diff --git a/src/styles/box/variables.scss b/src/styles/box/variables.scss new file mode 100644 index 0000000000..3fda98f7eb --- /dev/null +++ b/src/styles/box/variables.scss @@ -0,0 +1,5 @@ +$star-width: 13px; +$star-height: 13px; +$card-width: 200px; +$star-bg: url('../images/star.svg'); +$star-active-bg: url('../images/star-active.svg'); diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..eecab39431 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,14 @@ +.page { + margin: 0; +} + body { margin: 0; + font-family: Roboto, sans-serif; } + +@import './box/variables'; +@import 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap'; +@import './box/card'; +@import './box/stars'; +@import './box/header';