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

Moyo header #5369

Closed
wants to merge 6 commits into from
Closed
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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,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 `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://Oleg473.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Oleg473.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 Down
104 changes: 102 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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, user-scalable=no, initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0"
/>
<meta
http-equiv="X-UA-Compatible"
Expand All @@ -15,8 +15,108 @@
rel="stylesheet"
href="./style.css"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin
>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
rel="stylesheet"
>
<title>Moyo header</title>

Choose a reason for hiding this comment

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

There are two title tags within the head section. Remove the duplicate title tag to comply with proper HTML structure.

</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#header"
class="logo"
>
<img
src="images/logo.png"
alt="Moyo-Logo"
/>
Comment on lines +35 to +42

Choose a reason for hiding this comment

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

Don't use spaces in <a> tag's href property. Anchor links should start with the # symbol. Also, ensure that the href attribute links to the correct section of the page. If #header is not an actual id on the page, it should be updated to reflect the correct navigation target.

</a>
<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Comment on lines +47 to +50

Choose a reason for hiding this comment

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

The class="nav__link is-active" suggests that all links are active, which is typically not the case. Usually, only one navigation link is 'active' at a time, indicating the current page or section. Ensure that the 'is-active' class is only applied to the appropriate link.

Apple
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Samsung
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Smartphones
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
data-qa="hover"
>
Laptops & Computers
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Gadgets
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Tablets
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Photo
</a>
</li>

<li class="nav__item">
<a
class="nav__link is-active"
href="#header"
>
Video
</a>
</li>
</ul>
</nav>
Comment on lines +43 to +119

Choose a reason for hiding this comment

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

Add empty lines between multiline sibling blocks of HTML to add some 'air' and simplify reading. For example, there should be an empty line before and after each <li class="nav__item"> block.

</header>
</body>
</html>
83 changes: 82 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,84 @@
body {
body{
padding: 0;
margin: 0;
padding-bottom: 2000px;
}


:root{
--header-height: 60px;
}

.roboto-medium {
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
}

.header {
display: flex;
margin: 0 50px;
justify-content: space-between;

}

.logo {
height: 40px;
width: 40px;
object-fit: contain;
padding: 10px 0;
}

.nav {
text-transform: uppercase;
}

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

.nav__item{
transition: all ease-in-out 0.15s;
}

.nav__item:not(:first-child){
margin-left: 20px;
}

.nav__link{
font-weight: 500;
font-size: 12px;
height: var(--header-height);
line-height: var(--header-height);
font-family: Roboto, sans-serif;
text-decoration: none;
display: inline-block;
color: inherit;
}

.nav__item:hover {
color: #00ACDC;
}

.is-active{
position: relative;
}

.is-active::after{
content: '';
position: absolute;
border: 4px solid #00ACDC;
border-radius: 8px;
width: calc(100% - 5px);
bottom: 0;
left: 0;
opacity: 0;
}

.is-active:hover::after {
bottom: 0;
opacity: 1;
}
Loading