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 373f5d0040..1890861f0c 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", @@ -1230,10 +1230,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 4b42d42f7b..cc5756264b 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 b1f43ed970..72d87fece6 100644 --- a/readme.md +++ b/readme.md @@ -23,8 +23,8 @@ This is possible because [we use the Parcel library](https://en.parceljs.org/scs ❗️ Replace `` with your GitHub username and copy the links to the `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_product-cards/) -- [TEST REPORT LINK](https://.github.io/layout_product-cards/report/html_report/) +- [DEMO LINK](https://anastasiiadns.github.io/layout_product-cards/) +- [TEST REPORT LINK](https://anastasiiadns.github.io/layout_product-cards/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 43745cc17f..ae1be58cc0 100644 --- a/src/index.html +++ b/src/index.html @@ -1,5 +1,8 @@ - + + + + - -

Product cards

+ +
+ APPLE A1419 iMac 27 + +
+

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

+

Product code: 195434

+
+
+ +
+
+
+
+
+
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + diff --git a/src/styles/blocks/button.scss b/src/styles/blocks/button.scss new file mode 100644 index 0000000000..15a2b356c8 --- /dev/null +++ b/src/styles/blocks/button.scss @@ -0,0 +1,23 @@ +.button { + margin-left: $retreat-margin-left; + margin-top: 16px; + + width: $tablet-min-width; + height: 40px; + background-color: $main-butter-color; + border: 1px solid $main-butter-color; + border-radius: 5px; + cursor: pointer; + + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-align: center; + color: white; + + &:hover { + background-color: white; + color: $main-butter-color; + border: 1px solid $main-butter-color; + } +} diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..24c8d39368 --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,35 @@ +.card { + &__background { + margin-top: 33px; + margin-left: 20px; + margin-right: 20px; + width: 160px; + height: 134px; + background-size: contain; + background-repeat: no-repeat; + } + + &__text { + margin-left: $retreat-margin-left; + + &--name { + margin: 0; + padding-bottom: 4px; + padding-top: 35px; + font-size: 12px; + width: $tablet-min-width; + height: 36px; + font-weight: 500; + line-height: 18px; + } + + &--description { + margin: 0; + font-size: 10px; + color: #616070; + height: 14px; + font-weight: 400; + line-height: 14px; + } + } +} diff --git a/src/styles/blocks/cost.scss b/src/styles/blocks/cost.scss new file mode 100644 index 0000000000..6241cf4c08 --- /dev/null +++ b/src/styles/blocks/cost.scss @@ -0,0 +1,22 @@ +.cost { + display: flex; + justify-content: space-between; + margin-left: $retreat-margin-left; + margin-top: 24px; + width: $tablet-min-width; + + &__text { + margin: 0; + font-size: 12px; + line-height: 18px; + font-weight: 400; + } + + &__price { + margin: 0; + font-size: 16px; + line-height: 18px; + font-weight: 700; + text-align: right; + } +} diff --git a/src/styles/blocks/page.scss b/src/styles/blocks/page.scss new file mode 100644 index 0000000000..3f38f0c81d --- /dev/null +++ b/src/styles/blocks/page.scss @@ -0,0 +1,10 @@ +.page { + font-family: Roboto, sans-serif; + display: flex; + justify-content: center; + + &__body { + padding: 0; + box-sizing: border-box; + } +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..c5724df8d6 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,27 @@ +.stars { + display: flex; + margin-left: $retreat-margin-left; + margin-top: 16px; + width: $tablet-min-width; + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + height: 16px; + width: 16px; + padding-right: 4px; + } + + &--4 &__star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); + } + + &__reviews { + margin: 0; + font-size: 10px; + font-weight: 400; + line-height: 14px; + text-align: right; + padding-left: 17px; + } +} diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..5a640cc54e 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,6 @@ -body { - margin: 0; -} +@import './utils/variables'; +@import './blocks/page'; +@import './blocks/card'; +@import './blocks/stars'; +@import './blocks/cost'; +@import './blocks/button'; diff --git a/src/styles/utils/variables.scss b/src/styles/utils/variables.scss new file mode 100644 index 0000000000..4b859dab2b --- /dev/null +++ b/src/styles/utils/variables.scss @@ -0,0 +1,3 @@ +$main-butter-color: #00acdc; +$tablet-min-width: 166px; +$retreat-margin-left: 17px;