From a9f3a58a27e320bdfc3b5013dd1f6e0a05cedce8 Mon Sep 17 00:00:00 2001 From: nazarkhorolskyi Date: Wed, 29 Jul 2026 09:47:45 +0200 Subject: [PATCH 1/2] The checklist task has been completed. --- .github/workflows/test.yml-template | 29 +++++++++++++++++++ package-lock.json | 9 +++--- package.json | 3 +- readme.md | 6 ++-- src/index.html | 43 ++++++++++++++++++++++++++++- src/style.css | 39 ++++++++++++++++++++++++++ 6 files changed, 119 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test.yml-template 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 679d844cb7..f0f21d0865 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", "backstopjs": "6.3.23", "jest": "^29.7.0", @@ -1211,10 +1211,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", diff --git a/package.json b/package.json index 28b7ea9ca7..f47f031da9 100644 --- a/package.json +++ b/package.json @@ -17,13 +17,12 @@ "keywords": [], "author": "Mate Academy", "license": "GPL-3.0", - "dependencies": {}, "devDependencies": { "@linthtml/linthtml": "^0.9.6", "@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", "backstopjs": "6.3.23", "jest": "^29.7.0", diff --git a/readme.md b/readme.md index b8c3a1d3f2..7ea85868a3 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ Implement the [Stars Block](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2960) used in a card and catalog. -Hold `Alt` key (`Option` on MacOS) to measure distances in Figma. +Hold `Alt` key (`Option` on MacOS) to measure distances in Figma. > Here are the [Layout Tasks Instructions](https://mate-academy.github.io/layout_task-guideline) @@ -22,8 +22,8 @@ Hold `Alt` key (`Option` on MacOS) to measure distances in Figma. ❗️ Replace `` with your Github username and copy the links to `Pull Request` description: -- [DEMO LINK](https://.github.io/layout_stars/) -- [TEST REPORT LINK](https://.github.io/layout_stars/report/html_report/) +- [DEMO LINK](https://Nazar-Khorolskiy.github.io/layout_stars/) +- [TEST REPORT LINK](https://Nazar-Khorolskiy.github.io/layout_stars/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 3e4d7e8ab0..f96de61c04 100644 --- a/src/index.html +++ b/src/index.html @@ -13,6 +13,47 @@ /> -

Stars

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/style.css b/src/style.css index a63fa10d43..be05ed578f 100644 --- a/src/style.css +++ b/src/style.css @@ -1 +1,40 @@ /* add styles here */ +body { + margin: 0; +} + +.stars { + display: flex; +} + +.stars__star { + width: 16px; + height: 16px; + background-image: url(images/star.svg); + background-repeat: no-repeat; + background-position: center; +} + +.stars__star + .stars__star { + margin-left: 4px; +} + +.stars--1 .stars__star:nth-child(-n + 1) { + background-image: url('./images/star-active.svg'); +} + +.stars--2 .stars__star:nth-child(-n + 2) { + background-image: url('./images/star-active.svg'); +} + +.stars--3 .stars__star:nth-child(-n + 3) { + background-image: url('./images/star-active.svg'); +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url('./images/star-active.svg'); +} + +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url('./images/star-active.svg'); +} From 8f4bbe85b41fc30343812ab8d9456715be6868c8 Mon Sep 17 00:00:00 2001 From: nazarkhorolskyi Date: Thu, 30 Jul 2026 08:48:13 +0200 Subject: [PATCH 2/2] fixing the CSS file, adding the stars.css file --- src/stars.css | 35 +++++++++++++++++++++++++++++++++++ src/style.css | 39 ++------------------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 src/stars.css diff --git a/src/stars.css b/src/stars.css new file mode 100644 index 0000000000..743e2c646b --- /dev/null +++ b/src/stars.css @@ -0,0 +1,35 @@ +.stars { + display: flex; +} + +.stars__star { + width: 16px; + height: 16px; + background-image: url(images/star.svg); + background-repeat: no-repeat; + background-position: center; +} + +.stars__star + .stars__star { + margin-left: 4px; +} + +.stars--1 .stars__star:nth-child(-n + 1) { + background-image: url('./images/star-active.svg'); +} + +.stars--2 .stars__star:nth-child(-n + 2) { + background-image: url('./images/star-active.svg'); +} + +.stars--3 .stars__star:nth-child(-n + 3) { + background-image: url('./images/star-active.svg'); +} + +.stars--4 .stars__star:nth-child(-n + 4) { + background-image: url('./images/star-active.svg'); +} + +.stars--5 .stars__star:nth-child(-n + 5) { + background-image: url('./images/star-active.svg'); +} diff --git a/src/style.css b/src/style.css index be05ed578f..a8b1995046 100644 --- a/src/style.css +++ b/src/style.css @@ -1,40 +1,5 @@ -/* add styles here */ +@import 'stars.css'; + body { margin: 0; } - -.stars { - display: flex; -} - -.stars__star { - width: 16px; - height: 16px; - background-image: url(images/star.svg); - background-repeat: no-repeat; - background-position: center; -} - -.stars__star + .stars__star { - margin-left: 4px; -} - -.stars--1 .stars__star:nth-child(-n + 1) { - background-image: url('./images/star-active.svg'); -} - -.stars--2 .stars__star:nth-child(-n + 2) { - background-image: url('./images/star-active.svg'); -} - -.stars--3 .stars__star:nth-child(-n + 3) { - background-image: url('./images/star-active.svg'); -} - -.stars--4 .stars__star:nth-child(-n + 4) { - background-image: url('./images/star-active.svg'); -} - -.stars--5 .stars__star:nth-child(-n + 5) { - background-image: url('./images/star-active.svg'); -}