Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task solution #3499

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# Stars block

Replace `<your_account>` with your Github username and copy the links to Pull Request description:
- [DEMO LINK](https://<your_account>.github.io/layout_stars/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_stars/report/html_report/)

- [DEMO LINK](https://reznik-denis.github.io/layout_stars/)
- [TEST REPORT LINK](https://reznik-denis.github.io/layout_stars/report/html_report/)

> Follow [this instructions](https://mate-academy.github.io/layout_task-guideline)
___

---

> Disable `Multiplayer Cursors` in figma to hide other cursors ([Learn how](https://mate-academy.github.io/layout_task-guideline/figma.html#multiplayer-cursors))
___

---

## ❗️❗️❗️ DON'T FORGET TO PROOFREAD YOUR CODE WITH [CHECKLIST](https://github.com/mate-academy/layout_stars/blob/master/checklist.md) BEFORE SENDING YOUR PULL REQUEST❗️❗️❗️

## The task

Implement the [`stars` block](https://www.figma.com/file/EIBkG1dy1jnK88YPO34Qir/Moyo-Catalog-updated) used in a card and catalog.
You DON'T need to implement the card now, just the stars block.

![Stars](./reference/stars.png)
___

---

- You can find star images in the `images` folder
- Reset browser's default `margin`
- Implement 6 blocks with `stars` class. Each block should have 5 elements inside with the class `stars__star`.
Expand All @@ -27,10 +34,12 @@ ___
- The block with `stars--N` modifier should have exactly `N` first stars active

---

--> [CHECKLIST](https://github.com/mate-academy/layout_stars/blob/master/checklist.md)

## Tips & Hints

- Check the design again. See the difference in size between star image and its
container?
container?
- There's no need to add vertical margins between rows of stars.
- !!! DON'T use `gap` property for `flex` container because it does not work in tests
48 changes: 47 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,52 @@
<link rel="stylesheet" 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>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line between each block

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


<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>
31 changes: 31 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
html {
box-sizing: border-box;
}

body {
margin: 0;
}

.stars {
display: flex;
}

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

.stars__star:not(:last-child) {
margin-right: 4px;
}

.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);
}
Loading