From 440a64d881392f4abec6ddad81d8fca12b34cfe3 Mon Sep 17 00:00:00 2001 From: Nazar Vandenko Date: Thu, 17 Oct 2024 15:40:50 +0300 Subject: [PATCH] add task solution --- readme.md | 6 +++--- src/images/Star.png | Bin 0 -> 353 bytes src/index.html | 43 ++++++++++++++++++++++++++++++++++++++- src/style.css | 48 +++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 92 insertions(+), 5 deletions(-) create mode 100644 src/images/Star.png diff --git a/readme.md b/readme.md index b8c3a1d3f2..002042ba2d 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://thshnhta.github.io/layout_stars/) +- [TEST REPORT LINK](https://thshnhta.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/images/Star.png b/src/images/Star.png new file mode 100644 index 0000000000000000000000000000000000000000..b565362b0363f62494df0ed0b7d5b60b64a5bce3 GIT binary patch literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9GG!XV7ZFl&wkP>``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eB{x?q-$B+ufvq86cn;ZmUc=oGAG)`F{o56Yu zNQru|Pg@eQKsJHhM%bgmvRiJa%p5fpHNQ<(XU^%B?-uwgKX*7Hyd*(Z;>@xkYEx>*#5vZ>0`oD91?1 zP82xe?@l$$6lAdU|q{z9Ufym>u8{VQbkt6+VrdWE13M{ow<+Aa-PpT zaSiXbfN4)>nHcyMug_{`lkiJ_zmY3^4u-v@1GVR3Ac{#ukVDNPHb6Mw<&;$S>3xzoV literal 0 HcmV?d00001 diff --git a/src/index.html b/src/index.html index 3e4d7e8ab0..2b50ea263e 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..b259278e03 100644 --- a/src/style.css +++ b/src/style.css @@ -1 +1,47 @@ -/* add styles here */ +body { + margin: 0; + padding: 0; +} + +.stars { + display: flex; + padding-left: 0; + margin: 0; + list-style-type: none; +} + +.stars__star { + display: flex; + background: url(./images/star.svg) center no-repeat; + height: 16px; + width: 16px; + margin-right: 4px; +} + +.stars__star:last-child { + margin-right: 0; +} + +.stars--0 :nth-child(-n + 0) { + background-image: url(./images/star-active.svg); +} + +.stars--1 :nth-child(-n + 1) { + background-image: url(./images/star-active.svg); +} + +.stars--2 :nth-child(-n + 2) { + background-image: url(./images/star-active.svg); +} + +.stars--3 :nth-child(-n + 3) { + background-image: url(./images/star-active.svg); +} + +.stars--4 :nth-child(-n + 4) { + background-image: url(./images/star-active.svg); +} + +.stars--5 :nth-child(-n + 5) { + background-image: url(./images/star-active.svg); +}