Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksandr committed Oct 31, 2024
1 parent bfc531d commit 2ab411a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 2 deletions.
Binary file added src/images/Star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/images/star-active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 43 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,49 @@
href="./style.css"
/>
</head>

<body>
<h1>Stars</h1>
<div class="stars stars--0">
<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--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>
<div class="stars__star"></div>
<div class="stars__star"></div>
<div class="stars__star"></div>
</div>
</body>
</html>
27 changes: 26 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
/* 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--0 .stars__star:nth-child(-n),
.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 2ab411a

Please sign in to comment.