Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Moyo header

Create an HTML page with the header using `flexbox` based on the [Figma Mockup](https://www.figma.com/file/1sog2rmfyCjnVxkeZ3ptnc/MOYO-%2F-Header?node-id=0%3A1&mode=dev).

The page should match the design Pixel Perfect: all the sizes, colors and distances MUST be the same as on the design.
Expand Down Expand Up @@ -27,8 +28,8 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan

❗️ Replace `<your_account>` with your GitHub username and copy the links to the `Pull Request` description:

- [DEMO LINK](https://<your_account>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<your_account>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://Staskovych.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Staskovych.github.io/layout_moyo-header/report/html_report/)

❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each point after you checked it.

Expand All @@ -39,5 +40,5 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan
- [ ] **CSS Variable** is used for a blue color
- [ ] Pseudo-element is used for a blue line below the active link
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
85 changes: 84 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,95 @@
content="ie=edge"
/>
<title>Moyo header</title>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"

Choose a reason for hiding this comment

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

This line slightly exceeds the 80-character limit. Please ensure all lines of code respect the maximum length as per the project's style guide.

rel="stylesheet"
/>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#"
class="logo"
>
<img
src="./images/logo.png"
alt="moyo company logo"
/>
</a>
<nav>
<ul class="nav__list">
<li class="nav__item">
<a
href="#"
class="nav__link is-active"
>
Apple
</a>
</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Samsung
</a>
</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Smartphones
</a>
</li>
<li class="nav__item">
<a
href="#"
data-qa="hover"
class="nav__link"
>
Laptops & Computers
</a>
</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Gadgets
</a>
</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Tablets
</a>
Comment on lines +80 to +83

Choose a reason for hiding this comment

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

This media query reintroduces an issue from the previous review. Setting a fixed height on the .header violates the requirement that the header's height should be determined by the line-height of the links ([CHECKLIST ITEM #1]).

Additionally, width: 1024px will prevent the header from stretching to the full page width on smaller screens, causing horizontal scrolling.

</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Photo
</a>
</li>
<li class="nav__item">
<a
href="#"
class="nav__link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
74 changes: 74 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
:root {
--color-blue: #00acdc;
}

body {
margin: 0;
padding: 0;
font-family: Roboto, sans-serif;
font-weight: 500;
}

.header {
display: flex;
width: 100%;
justify-content: space-between;
box-sizing: border-box;
align-items: center;
padding: 0 50px;
}

.logo {
display: block;
height: 40px;
width: 40px;
}

.nav__list {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}

.nav__item {
margin-left: 20px;
}

.nav__item:first-child {
margin: 0;
}

.nav__link {
display: block;
padding: 0;
line-height: 60px;
font-size: 12px;
text-decoration: none;
color: #000;
text-transform: uppercase;
}

.nav__link:hover {
color: var(--color-blue);
}

.nav__link.is-active {
color: var(--color-blue);
position: relative;
}

.nav__link.is-active::after {
content: '';
position: absolute;
border-radius: 8px;
height: 4px;
width: 100%;
left: 0;
bottom: 0;
background-color: var(--color-blue);
}

@media (max-width: 1024px) {
.header {
width: 1024px;
height: 60px;

Choose a reason for hiding this comment

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

This line violates the requirement that the header's height should be determined by the navigation links, not a fixed height on the header element itself. This is mentioned in checklist item #1: 'Header height is set in 1 place (for the links)'.

Please remove this height property. The line-height on the .nav__link already establishes the header's height.

}
}