Skip to content

Commit

Permalink
corrections added
Browse files Browse the repository at this point in the history
  • Loading branch information
Detek-tor authored Nov 3, 2024
1 parent 8d25f7d commit 82478bb
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 121 deletions.
118 changes: 59 additions & 59 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<title>Stars</title>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<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>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<title>Stars</title>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<div class="stars stars--0">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="stars stars--1">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="stars stars--2">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="stars stars--3">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="stars stars--4">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
<div class="stars stars--5">
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
<span class="stars__star"></span>
</div>
</body>
</html>
87 changes: 25 additions & 62 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,62 +1,25 @@
body {
margin: 0;
}

.stars {
display: flex;
width: 100px;
}

.stars__star {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star.svg');
}

.stars--1 .stars__star:nth-child(-n + 1) {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star-active.svg');
}

.stars--2 .stars__star:nth-child(-n + 2) {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star-active.svg');
}

.stars--3 .stars__star:nth-child(-n + 3) {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star-active.svg');
}

.stars--4 .stars__star:nth-child(-n + 4) {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star-active.svg');
}

.stars--5 .stars__star:nth-child(-n + 5) {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star-active.svg');
}
body {
margin: 0;
}

.stars {
display: flex;
width: 100px;
}

.stars__star {
width: 16px;
height: 16px;
margin-right: 4px;
background-repeat: no-repeat;
background-position: center;
background-image: url('images/star.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 82478bb

Please sign in to comment.