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..a1c3f92dc2 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", @@ -5471,87 +5472,6 @@ "node": ">=12 || >=16" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/fb55" - } - }, - "node_modules/css-select/node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" - }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "domelementtype": "^2.3.0" - }, - "engines": { - "node": ">= 4" - }, - "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" - } - }, - "node_modules/css-select/node_modules/domutils": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", - "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" - } - }, - "node_modules/css-select/node_modules/entities": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", - "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/css-tree": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.3.1.tgz", @@ -5589,45 +5509,6 @@ "node": ">=4" } }, - "node_modules/csso": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", - "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "css-tree": "~2.2.0" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/css-tree": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", - "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "mdn-data": "2.0.28", - "source-map-js": "^1.0.1" - }, - "engines": { - "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/csso/node_modules/mdn-data": { - "version": "2.0.28", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", - "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", - "dev": true, - "optional": true, - "peer": true - }, "node_modules/data-uri-to-buffer": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", @@ -10757,20 +10638,6 @@ "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "dev": true }, - "node_modules/srcset": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/srcset/-/srcset-5.0.1.tgz", - "integrity": "sha512-/P1UYbGfJVlxZag7aABNRrulEXAwCSDo7fklafOQrantuPTDmYgijJMks2zusPCVzgW9+4P69mq7w6pYuZpgxw==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/stable": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz", @@ -11176,33 +11043,6 @@ "integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==", "dev": true }, - "node_modules/svgo": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-3.3.2.tgz", - "integrity": "sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@trysound/sax": "0.2.0", - "commander": "^7.2.0", - "css-select": "^5.1.0", - "css-tree": "^2.3.1", - "css-what": "^6.1.0", - "csso": "^5.0.5", - "picocolors": "^1.0.0" - }, - "bin": { - "svgo": "bin/svgo" - }, - "engines": { - "node": ">=14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/svgo" - } - }, "node_modules/table": { "version": "6.8.2", "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", 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/src/index.html b/src/index.html index 9cff78eeb7..e5a8bae6cf 100644 --- a/src/index.html +++ b/src/index.html @@ -22,6 +22,327 @@ -

Catalog

+
+ + + + +
+
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ + Buy + +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

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

+ Product code: 195434 +
+
+
+
+
+
+
+
+
+
Reviews: 5
+
+
+
Price:
+
$2,199
+
+ Buy +
+
+ monitor APPLE +
+

+ 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..c9520d384a 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,3 +1,226 @@ +@use './stars.scss'; + +:root { + --light-blue: #00acdc; + --blue: #34568b; + --dark-blue: #060b35; + --white: #fff; + --hight-grey: #f3f3f3; + --grey: #616070; +} + +html, body { + font-family: Roboto, sans-serif; + font-weight: 500; + margin: 0; + padding: 0; +} + +.nav__anchor { + display: block; + text-decoration: none; + color: var(--dark-blue); + height: 60px; + line-height: 60px; + font-size: 12px; + text-transform: uppercase; + cursor: pointer; + text-align: center; + transition: color 300ms ease; + + &:hover { + color: var(--light-blue); + } +} + +.header { + box-sizing: border-box; + height: 60px; + line-height: 60px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 50px 0 0; + + &__logo-link { + display: flex; + padding: 10px 0; + width: 40px; + height: 40px; + margin-left: 50px; + } +} + +.nav__list { + display: flex; + align-items: center; + padding: 0; + list-style: none; +} + +.nav__item { + list-style: none; + + &:first-child { + margin-left: 0; + } +} + +.nav__item + .nav__item { + margin-left: 20px; +} + +.nav__anchor.is-active { + box-sizing: border-box; + position: relative; + color: var(--light-blue); + + &::after { + display: block; + box-sizing: border-box; + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 3px; + background: var(--light-blue); + border-radius: 8px; + } +} + +.catalog { + $card-count: 1; + $card-width: 200px; + + display: grid; + margin: 0; + grid-template-columns: repeat($card-count, $card-width); + justify-content: center; + gap: 46px 48px; + padding: 50px 40px; + + @media (min-width: 488px) { + grid-template-columns: repeat($card-count * 2, $card-width); + } + + @media (min-width: 768px) { + grid-template-columns: repeat($card-count * 3, $card-width); + } + + @media (min-width: 1024px) { + grid-template-columns: repeat($card-count * 4, $card-width); + } +} + +.card { margin: 0; + padding: 0; + display: block; + box-sizing: border-box; + background-color: var(--white); + width: 200px; + border: 1px solid var(--hight-grey); + border-radius: 5px; + transition: all 300ms ease; + + &__title { + font-weight: 500; + font-size: 12px; + line-height: 18px; + margin: 0; + transition: color 300ms ease; + } + + &:hover { + transform: scale(1.2); + + .card__title { + color: var(--blue); + } + } + + &__img { + display: block; + width: 160px; + height: 134px; + margin: 32px auto; + } + + &__info { + margin-top: 40px; + margin-inline: 16px; + } + + &__code { + color: var(--grey); + font-weight: 400; + font-size: 10px; + line-height: 14px; + margin-top: 4px; + } + + &__rating { + margin: 16px; + display: flex; + justify-content: space-between; + align-items: center; + } + + &__reviews { + color: var(--dark-blue); + font-weight: 400; + font-size: 10px; + line-height: 14px; + } + + &__prise-box { + margin-top: 24px; + margin-inline: 16px; + display: flex; + justify-content: space-between; + align-items: center; + } + + &__price-label { + font-weight: 400; + font-size: 12px; + line-height: 18px; + color: var(--grey); + } + + &__price-value { + font-weight: 700; + font-size: 16px; + line-height: 18px; + color: var(--dark-blue); + } + + &__button { + display: inline-block; + text-decoration: none; + text-align: center; + line-height: 40px; + box-sizing: border-box; + margin: 16px auto; + height: 40px; + width: 166px; + background-color: var(--light-blue); + color: var(--white); + border: 1px solid transparent; + text-transform: uppercase; + font-weight: 700; + font-size: 14px; + border-radius: 5px; + transition: + background-color 300ms ease, + color 300ms ease; + + &:hover { + color: var(--light-blue); + background-color: var(--white); + border: 1px solid var(--light-blue); + } + } } diff --git a/src/styles/stars.scss b/src/styles/stars.scss new file mode 100644 index 0000000000..79605f8601 --- /dev/null +++ b/src/styles/stars.scss @@ -0,0 +1,22 @@ +.stars { + display: flex; + + &__star { + display: block; + height: 16px; + width: 16px; + background-image: url(../images/star.svg); + background-repeat: no-repeat; + background-position: center; + margin: 0 auto; + padding: 0; + + &:last-child { + margin-right: 0; + } + } +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url(../images/star-active.svg); +}