From a79ca1d0621e1c4a07c6d5a703d3b5f7f2039aaa Mon Sep 17 00:00:00 2001 From: JosielLinhar Date: Fri, 1 Nov 2024 15:20:28 -0300 Subject: [PATCH 1/2] add task solution --- readme.md | 9 +++++---- src/index.html | 43 ++++++++++++++++++++++++++++++++++++++++++- src/style.css | 38 +++++++++++++++++++++++++++++++++++++- 3 files changed, 84 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index b8c3a1d3f2..3c0ae59021 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,13 @@ # Stars block -Implement the [Stars Block](https://www.figma.com/file/ojkArVazq7vsX0nbpn9CxZ/Moyo-%2F-Catalog-(ENG)?node-id=11325%3A2960) used in a card and catalog. +Implement the [Stars Block]() 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) ## Requirements: + - Reset browser's default `margin` - Add 6 `stars` blocks with 5 `stars__star` elements each. - Add `stars--0`, `stars--1`, `stars--2` ... `stars--5` modifiers to the blocks one per each @@ -22,8 +23,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://josiellinhar.github.io/layout_stars/) +- [TEST REPORT LINK](https://josiellinhar.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..85a3f43feb 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..6f6c1323b4 100644 --- a/src/style.css +++ b/src/style.css @@ -1 +1,37 @@ -/* add styles here */ +body { + margin: 0; +} + +.stars { + display: flex; +} + +.stars__star { + width: 16px; + height: 16px; + margin-right: 4px; + + background-image: url(images/star.svg); + background-repeat: no-repeat; + background-position: center; +} + +.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 34b5025a7e125f60fc864d060f7e4d960c9e5878 Mon Sep 17 00:00:00 2001 From: JosielLinhar Date: Fri, 1 Nov 2024 15:43:20 -0300 Subject: [PATCH 2/2] pull request resolution --- src/index.html | 2 +- src/styles/blocks/page.css | 3 +++ src/{style.css => styles/blocks/stars.css} | 16 ++++++---------- src/styles/style.css | 2 ++ 4 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 src/styles/blocks/page.css rename src/{style.css => styles/blocks/stars.css} (54%) create mode 100644 src/styles/style.css diff --git a/src/index.html b/src/index.html index 85a3f43feb..cf3970e5c7 100644 --- a/src/index.html +++ b/src/index.html @@ -9,7 +9,7 @@ Stars diff --git a/src/styles/blocks/page.css b/src/styles/blocks/page.css new file mode 100644 index 0000000000..293d3b1f13 --- /dev/null +++ b/src/styles/blocks/page.css @@ -0,0 +1,3 @@ +body { + margin: 0; +} diff --git a/src/style.css b/src/styles/blocks/stars.css similarity index 54% rename from src/style.css rename to src/styles/blocks/stars.css index 6f6c1323b4..93ca3a8695 100644 --- a/src/style.css +++ b/src/styles/blocks/stars.css @@ -1,7 +1,3 @@ -body { - margin: 0; -} - .stars { display: flex; } @@ -11,27 +7,27 @@ body { height: 16px; margin-right: 4px; - background-image: url(images/star.svg); + background-image: url(../../images/star.svg); background-repeat: no-repeat; background-position: center; } .stars--1 .stars__star:nth-child(-n + 1) { - background-image: url(images/star-active.svg); + background-image: url(../../images/star-active.svg); } .stars--2 .stars__star:nth-child(-n + 2) { - background-image: url(images/star-active.svg); + background-image: url(../../images/star-active.svg); } .stars--3 .stars__star:nth-child(-n + 3) { - background-image: url(images/star-active.svg); + background-image: url(../../images/star-active.svg); } .stars--4 .stars__star:nth-child(-n + 4) { - background-image: url(images/star-active.svg); + background-image: url(../../images/star-active.svg); } .stars--5 .stars__star:nth-child(-n + 5) { - background-image: url(images/star-active.svg); + background-image: url(../../images/star-active.svg); } diff --git a/src/styles/style.css b/src/styles/style.css new file mode 100644 index 0000000000..c0ceec0afd --- /dev/null +++ b/src/styles/style.css @@ -0,0 +1,2 @@ +@import 'blocks/page.css'; +@import 'blocks/stars.css';