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

layout_moyo-header solution #5830

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
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://ibabiuk.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://ibabiuk.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
86 changes: 86 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,94 @@
rel="stylesheet"
href="./style.css"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500;700&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="http://localhost:8080/"
class="logo"
>
<img
class="img"
src="./images/logo.png"
alt="MOYO img"
/>
</a>

<nav>
<ul class="navigation">
<li>
<a
href="http://localhost:8080/"
class="navbar is-active"
>
apple
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
samsung
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
smartphones
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar for-test"
data-qa="hover"
>
laptops & computers
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
gadgets
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
tablets
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
photo
</a>
</li>
<li>
<a
href="http://localhost:8080/"
class="navbar"
>
video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
68 changes: 68 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,71 @@
* {

Choose a reason for hiding this comment

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

Using the universal selector (*) is against the checklist requirements due to potential performance impacts. Consider applying styles more selectively to improve performance.

margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Roboto, sans-serif;

Choose a reason for hiding this comment

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

The font-family is set globally, which is fine, but ensure that the 'Roboto' font is correctly loaded in your HTML file. This is already done in your HTML file using Google Fonts, so this line is correctly implemented.

}

body {
font-size: 12px;
margin: 0;
background-color: gray;
}

.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: #fff;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
box-sizing: border-box;
}

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

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

.navbar {
display: inline-block;
position: relative;
text-align: center;
line-height: 60px;
text-decoration: none;
color: #000;
text-transform: uppercase;
}

.navigation li:not(:last-child) {
margin-right: 20px;
}

.navbar:hover {
color: #00acdc;
}

.navbar.is-active {
color: #00acdc;
}

.navbar.is-active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 4px;
border-radius: 8px;
background: #00acdc;
Comment on lines +55 to +70

Choose a reason for hiding this comment

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

The color #00acdc is used multiple times. The task requires using a CSS variable for the blue color. Consider defining a CSS variable for this color and using it throughout the stylesheet.

}
Loading