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 cf0977c416..796c166842 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Create HTML page with catalog. Develop semantic page structure as shown on [the - add `data-qa="card-hover"` (not just `hover`) to the link `Buy` inside the first card - nav links color is not `black` any more (nav links should have `#060b35` color) - add class `is-active` to the first link (`Apple`) in navigation -- use `
` tag for cards container +- use `
` tag for cards container - use grid for cards with different number of columns: - 1 for the smaller screens - 2 starting at `488px` diff --git a/src/blocks/card.scss b/src/blocks/card.scss new file mode 100644 index 0000000000..679fa71867 --- /dev/null +++ b/src/blocks/card.scss @@ -0,0 +1,98 @@ +.card { + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 200px; + + font-family: Roboto, sans-serif; + font-weight: 400; + font-style: normal; + border: 1px solid #f3f3f3; + border-radius: 5px; + transition: all 0.3s ease; + + &:hover { + transform: scale(1.2); + } + + &:hover .card__title { + color: #34568b; + } + + &__logo { + background-image: url(../images/imac.jpeg); + background-size: contain; + background-repeat: no-repeat; + width: 160px; + height: 134px; + margin: 32px 19px 40px; + } + + &__content { + margin: 0 16px 16px; + } + + &__header { + font-weight: 500; + font-size: 12px; + line-height: 18px; + color: $main-text-color; + } + + &__code { + font-size: 10px; + line-height: 14px; + color: $secondary-color; + margin-top: 4px; + } + + &__evaluation { + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 16px; + } + + &__reviews { + font-size: 10px; + color: $main-text-color; + } + + &__price { + display: flex; + justify-content: space-between; + margin-top: 24px; + + &-title { + font-size: 12px; + line-height: 18px; + color: $secondary-color; + } + + &-value { + font-size: 16px; + line-height: 18px; + font-weight: 700; + } + } + + &__buy-button { + height: 40px; + width: 166px; + border-radius: 5px; + border: none; + background-color: $blue-accent; + color: #fff; + font-weight: 700; + font-size: 14px; + line-height: 16px; + margin-top: 16px; + + &:hover { + background-color: #fff; + color: #00acdc; + border: 1px solid $blue-accent; + cursor: pointer; + } + } +} diff --git a/src/blocks/catalog.scss b/src/blocks/catalog.scss new file mode 100644 index 0000000000..58cf379ae1 --- /dev/null +++ b/src/blocks/catalog.scss @@ -0,0 +1,26 @@ +.catalog { + padding: 50px 40px; + display: grid; + grid-template-rows: repeat(2, 1fr); + grid-template-columns: repeat(1, 1fr); + gap: 46px 48px; + justify-items: center; +} + +@media (min-width: 488px) { + .catalog { + grid-template-columns: repeat(2, 1fr); + } +} + +@media (min-width: 768px) { + .catalog { + grid-template-columns: repeat(3, 1fr); + } +} + +@media (min-width: 1024px) { + .catalog { + grid-template-columns: repeat(4, 1fr); + } +} diff --git a/src/blocks/header.scss b/src/blocks/header.scss new file mode 100644 index 0000000000..a0b67e9afe --- /dev/null +++ b/src/blocks/header.scss @@ -0,0 +1,7 @@ +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 50px; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05); +} diff --git a/src/blocks/nav.scss b/src/blocks/nav.scss new file mode 100644 index 0000000000..2ad9aad222 --- /dev/null +++ b/src/blocks/nav.scss @@ -0,0 +1,55 @@ +.nav { + display: flex; + background-color: $bg-color; + + &__item { + margin: 0 10px; + text-decoration: none; + list-style: none; + } + + &__link { + font-family: Roboto, sans-serif; + font-size: 12px; + position: relative; + text-decoration: none; + text-transform: uppercase; + font-weight: 500; + color: #060b35; + display: block; + line-height: 60px; + + &:hover { + color: $blue-accent; + } + } + + &__list { + display: flex; + margin: 0; + padding: 0; + + & :first-child { + margin-left: 0; + } + + & :last-child { + margin-right: 0; + } + } +} + +.is-active { + color: $blue-accent; +} + +.is-active::after { + content: ''; + position: absolute; + bottom: 0; + left: 0; + right: 0; + background-color: $blue-accent; + height: 4px; + border-radius: 8px; +} diff --git a/src/blocks/stars.scss b/src/blocks/stars.scss new file mode 100644 index 0000000000..93dc662563 --- /dev/null +++ b/src/blocks/stars.scss @@ -0,0 +1,19 @@ +.stars { + display: flex; + + &--4 :nth-child(-n + 4) { + background-image: url(/src/images/star-active.svg); + } + + &__star { + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + height: 16px; + width: 16px; + + &:not(:last-child) { + margin-right: 4px; + } + } +} diff --git a/src/index.html b/src/index.html index 9cff78eeb7..56608a7536 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,288 @@ -

Catalog

+
+ + +
+ +
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
+ +
+
+ APPLE A1419 iMac 27" Retina 5K Monoblock (MNED2UA/A) +
+
Product code: 195434
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ +
+
+
diff --git a/src/styles/index.scss b/src/styles/index.scss index 293d3b1f13..2b845e96f2 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,16 @@ +@import '../utils/variables'; +@import '../blocks/header'; +@import '../blocks/catalog'; +@import '../blocks/nav'; +@import '../blocks/card'; +@import '../blocks/stars'; + body { margin: 0; + padding: 0; +} + +.logo { + height: 40px; + width: 40px; } diff --git a/src/utils/variables.scss b/src/utils/variables.scss new file mode 100644 index 0000000000..24edb10790 --- /dev/null +++ b/src/utils/variables.scss @@ -0,0 +1,4 @@ +$main-text-color: #060b35; +$secondary-color: #616070; +$blue-accent: #00acdc; +$bg-color: #fff;