From 01cc1cf47b1462153a9d97052c9979f001fbeac6 Mon Sep 17 00:00:00 2001 From: Bohdan Date: Wed, 8 Jan 2025 14:13:19 +0200 Subject: [PATCH] add interface --- .github/workflows/test.yml-template | 29 ++++++++ package-lock.json | 9 +-- package.json | 2 +- src/index.html | 96 ++++++++++++++++++++++++- src/styles/blocks/card.scss | 104 ++++++++++++++++++++++++++++ src/styles/blocks/moyo-header.scss | 65 +++++++++++++++++ src/styles/blocks/stars.scss | 16 +++++ src/styles/blocks/variables.scss | 5 ++ src/styles/index.scss | 6 ++ 9 files changed, 326 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test.yml-template create mode 100644 src/styles/blocks/card.scss create mode 100644 src/styles/blocks/moyo-header.scss create mode 100644 src/styles/blocks/stars.scss create mode 100644 src/styles/blocks/variables.scss 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/src/index.html b/src/index.html index 9cff78eeb7..636689d72f 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,100 @@ -

Catalog

+
+
+ + logo moyo + + +
+
+
+
+
+ +
+ +

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

+ +

Product code: 195434

+ +
+
+ + + + + +
+ +

Reviews: 5

+
+ +
+

Price:

+

$2,199

+
+ + +
+
diff --git a/src/styles/blocks/card.scss b/src/styles/blocks/card.scss new file mode 100644 index 0000000000..80e262366d --- /dev/null +++ b/src/styles/blocks/card.scss @@ -0,0 +1,104 @@ +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 400; + font-style: normal; +} + +.card { + box-sizing: border-box; + width: 200px; + border: 1px solid #f3f3f3; + background-color: #fff; + display: flex; + flex-direction: column; + padding: $card-padding; + + &__img { + padding: 0 3px; + &-img { + display: block; + background-image: url('../images/imac.jpeg'); + background-size: cover; + height: 134px; + } + } + + &__header { + font-size: $font-size-base; + line-height: 18px; + font-weight: 500; + color: $main-text-color; + margin: 0; + padding-top: 40px; + } + + &__product-code { + font-size: 10px; + line-height: 14px; + font-weight: 400; + color: $second-text-color; + margin: 0; + padding-top: 4px; + } + + &__response { + padding-top: 16px; + display: flex; + justify-content: space-between; + + &-reviews { + font-size: 10px; + line-height: 14px; + font-weight: 400; + color: $main-text-color; + margin: 0; + text-align: center; + } + } + + &__price { + display: flex; + justify-content: space-between; + padding-top: 24px; + + &-price { + font-size: $font-size-base; + line-height: 18px; + font-weight: 400; + color: $second-text-color; + margin: 0; + } + + &-tag { + font-size: 16px; + line-height: 18px; + font-weight: 700; + color: $main-text-color; + margin: 0; + } + } + + &__button { + margin-top: 16px; + background-color: $main-button-color; + height: 40px; + padding: 0; + border: none; + border-radius: 5px; + width: 166px; + + text-transform: uppercase; + font-size: $font-size-base; + line-height: 16px; + font-weight: 700; + color: #fff; + text-decoration: none; + } + + &__button:active { + border: 1px solid $main-button-color; + background-color: #fff; + color: $main-button-color; + } +} diff --git a/src/styles/blocks/moyo-header.scss b/src/styles/blocks/moyo-header.scss new file mode 100644 index 0000000000..49a4ccc6b7 --- /dev/null +++ b/src/styles/blocks/moyo-header.scss @@ -0,0 +1,65 @@ +body { + margin: 0; + font-family: Roboto, sans-serif; + font-weight: 700; + font-style: normal; +} + +.header { + display: flex; + width: 100%; + background-color: #fff; + justify-content: space-between; + + .img { + display: block; + margin-left: 50px; + margin-top: 10px; + margin-bottom: 10px; + } + .nav { + margin-right: 50px; + display: flex; + align-items: center; + justify-content: center; + } + a { + text-decoration: none; + color: black; + } + + ul { + display: flex; + font-size: 12px; + list-style: none; + text-transform: uppercase; + font-weight: bold; + } + li:not(:last-child) { + margin-right: 20px; + } +} + +.blue { + color: #00acdc; +} + +a:hover { + color: #00acdc; +} + +.is-active { + color: #00acdc; + position: relative; +} + +.is-active::after { + content: ''; + position: absolute; + left: 0; + bottom: -22.5px; + width: 100%; + height: 4px; + border-radius: 8px; + background-color: #00acdc; +} diff --git a/src/styles/blocks/stars.scss b/src/styles/blocks/stars.scss new file mode 100644 index 0000000000..41be860c85 --- /dev/null +++ b/src/styles/blocks/stars.scss @@ -0,0 +1,16 @@ +.stars { + display: flex; + gap: 4px; + + &__line { + background-image: url('../images/star.svg'); + width: 16px; + height: 16px; + background-size: contain; + background-repeat: no-repeat; + } + + &__line:nth-child(-n + 4) { + background-image: url('../images/star-active.svg'); + } +} diff --git a/src/styles/blocks/variables.scss b/src/styles/blocks/variables.scss new file mode 100644 index 0000000000..63cc814027 --- /dev/null +++ b/src/styles/blocks/variables.scss @@ -0,0 +1,5 @@ +$card-padding: 32px 16px 16px; +$main-text-color: #060b35; +$second-text-color: #616070; +$main-button-color: #00acdc; +$font-size-base: 12px; diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..5ab91c4db2 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,9 @@ body { margin: 0; } + +@import 'blocks/variables'; +@import 'blocks/moyo-header'; +@import 'blocks/card'; +@import 'blocks/stars'; +