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 #5844

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

Develop #5844

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
5 changes: 3 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Moyo header

Create 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 distanced 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 `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://Dmy0.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Dmy0.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
50 changes: 49 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,56 @@
rel="stylesheet"
href="./style.css"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&amp;display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header>
<a
href="#"
class="logo"
>
<img
src="images/logo.png"
alt="logo"
/>
</a>
Comment on lines +33 to +41

Choose a reason for hiding this comment

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

Consider adding a more descriptive alt attribute for the logo image to improve accessibility. Instead of just 'logo', you could use something like 'Company Logo' or 'Moyo Logo'.

<nav>
<ul>
<li>
<a
href="/apple"
class="is-active"
>
Apple
</a>
</li>
<li><a href="/samsung">Samsung</a></li>
<li><a href="/smartphones">Smartphones</a></li>
<li>
<a
href="/laptops"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li><a href="/gadgets">Gadgets</a></li>
<li><a href="/tablets">Tablets</a></li>
<li><a href="/photo">Photo</a></li>
<li><a href="/video">Video</a></li>
</ul>
</nav>
</header>
Comment on lines +32 to +68

Choose a reason for hiding this comment

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

For better accessibility, consider using semantic HTML5 elements such as <nav> for the navigation bar instead of a generic <div> or <header>. This will help screen readers and other assistive technologies understand the structure of the page better.

</body>
</html>
73 changes: 73 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,76 @@
:root {
--link-color: #00acdc;
}

body {
font-family: Roboto, sans-serif;
margin: 0;
line-height: 1;
}

header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 50px;
}

.logo {
display: flex;
align-items: center;
}

.logo img {
width: 100%;
height: auto;
Comment on lines +24 to +25

Choose a reason for hiding this comment

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

Setting the width of the logo image to 100% might cause it to stretch if the container size changes. Consider setting a max-width instead to maintain the aspect ratio.

}

a {
text-transform: uppercase;
color: #000;

Choose a reason for hiding this comment

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

The default link color is set to black (#000). Ensure this provides enough contrast against the background for readability and accessibility. Consider using a color contrast checker to verify this.

display: flex;
align-items: center;
justify-content: center;
height: 60px;
font-size: 12px;
font-weight: 500;
text-decoration: none;
}

a:hover,
a.is-active {
color: var(--link-color);

Choose a reason for hiding this comment

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

Using CSS variables for colors is a good practice. Ensure that --link-color provides sufficient contrast against the background when used for active and hover states.

}

ul {
list-style: none;
display: flex;
position: relative;
margin: 0;
padding: 0;
}

li {
margin: 0 10px;
position: relative;
}

ul li:first-child {
margin-left: 0;
}

ul li:last-child {
margin-right: 0;
}

a.is-active::after {
content: '';
background-color: var(--link-color);
border-radius: 4px;
width: 100%;
height: 4px;
display: block;
position: absolute;
bottom: 0;
left: 0;
}
Loading