Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
reznik-denis committed Aug 22, 2023
1 parent 03b8da4 commit e24f961
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
5 changes: 5 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,39 @@
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>

<div class="stars stars--1">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>

<div class="stars stars--2">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>

<div class="stars stars--3">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>

<div class="stars stars--4">
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>

<div class="stars stars--5">
<div class="stars__star"></div>
<div class="stars__star"></div>
Expand Down
20 changes: 4 additions & 16 deletions src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,10 @@ body {
margin-right: 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--1 > .stars__star:nth-child(-n + 1),
.stars--2 > .stars__star:nth-child(-n + 2),
.stars--3 > .stars__star:nth-child(-n + 3),
.stars--4 > .stars__star:nth-child(-n + 4),
.stars--5 > .stars__star:nth-child(-n + 5) {
background-image: url(./images/star-active.svg);
}

0 comments on commit e24f961

Please sign in to comment.