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

develop #5480

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

develop #5480

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
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -13,7 +13,7 @@ Hold `Alt` key (`Option` on MacOS) to measure distances in Figma.
- Don't add any other classes to the elements.
- The block with `stars--N` modifier should have exactly `N` first stars active.
- use `background-image` for stars (see `images` folder). Don't use `<img>` or `<svg>` tags.
- The star size and the distance should be taken from Figma
- The star size and the distance should be taken from Figma<
- Use `display: flex` for the `stars` block to avoid an issue with extra spaces between individual stars
- Don't add vertical margins between blocks.
- DON'T use `gap` property for `flex` container because it does not work in tests
Expand All @@ -22,8 +22,8 @@ Hold `Alt` key (`Option` on MacOS) to measure distances in Figma.

❗️ 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://OlgaDnepr.github.io/layout_stars/)
- [TEST REPORT LINK](https://OlgaDnepr.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.

Expand Down
49 changes: 47 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- #region head -->
<!doctype html>
<html lang="en">
<head>
Expand All @@ -9,10 +10,54 @@
<title>Stars</title>
<link
rel="stylesheet"
href="./style.css"
href="style.css"
/>
</head>
<!-- endregion -->
<body>
<h1>Stars</h1>
<div class="box-stars">
<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>
Comment on lines +18 to +60

Choose a reason for hiding this comment

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

The current HTML structure does not follow the BEM methodology as required. Each BEM block should be in its own separate file. Consider restructuring your HTML to adhere to this requirement.

Comment on lines +18 to +60

Choose a reason for hiding this comment

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

Consider using more semantic HTML tags instead of generic div elements to improve accessibility and readability. For example, using <section>, <article>, or <nav> where appropriate.

</div>
</body>
</html>
41 changes: 40 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
/* add styles here */
body {
margin: 0;
}

.box-stars {
display: flex;
flex-direction: column;

/* justify-content: space-between; */

/* width: 96px;
height: 116px; */

/* padding: 22px; */
Comment on lines +9 to +14

Choose a reason for hiding this comment

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

There are several commented-out styles. If these styles are not needed, consider removing them to keep the CSS clean and maintainable.


background: #fff;
}

.stars {
display: flex;

/* justify-content: space-between; */
}

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

.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);
}
Comment on lines +5 to +40

Choose a reason for hiding this comment

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

The current CSS structure does not follow the BEM methodology as required. Each BEM block should have its own separate CSS file. Consider restructuring your CSS to adhere to this requirement.