Skip to content
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
6 changes: 3 additions & 3 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 @@ -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://DmutroHavriliuknpm run lint.github.io/layout_stars/)
- [TEST REPORT LINK](https://DmutroHavriliuk.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
57 changes: 55 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,68 @@
<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"
content="width=device-width, initial-scale=1.0"
/>

<title>Stars</title>

<link
rel="stylesheet"
href="./style.css"
Comment on lines 12 to 14

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The task and checklist require: "Each BEM block has its own separate file" and previous review noted stars block styles must be moved out of style.css. Your HTML links both ./style.css and ./star.css — this suggests the stars styles may still be in style.css. Ensure the stars block CSS is moved into a dedicated stars.css file (note exact filename in description is stars.css) and remove the stars styles from style.css so each BEM block has its own file.

/>
Comment on lines 12 to 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The description requires resetting the browser's default margin (for example: body { margin: 0; }). I don't see that here in HTML (it belongs in CSS). Make sure you add that reset in your global stylesheet (style.css) or in the correct CSS file, and keep stars-specific styles in the separate stars.css as required.

<link
rel="stylesheet"
href="./star.css"
Comment on lines +16 to +18

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The linked stylesheet filename is ./star.css (singular). The task and previous review mention stars.css (plural). Confirm the intended filename and use stars.css for the stars block stylesheet to match the checklist requirement and avoid confusion.

/>
</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>
23 changes: 23 additions & 0 deletions src/star.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.stars {
display: flex;
}

.stars__star {
width: 16px;
height: 16px;
margin-right: 4px;

background: url('./images/star.svg') center no-repeat;
}

.stars__star:last-child {
margin-right: 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');
}
3 changes: 3 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/* add styles here */
body {
margin: 0;
}
Loading