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

Open
wants to merge 2 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://AndrewT98.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://AndrewT98.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: 84 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<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 +16,89 @@
rel="stylesheet"
href="./style.css"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.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&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="#"
class="img-link"
>
<img
class="img"
src="./images/logo.png"
alt="MOYO Logo image"

Choose a reason for hiding this comment

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

The alt attribute for the image is present, but it could be more descriptive. Consider providing a more detailed description to enhance accessibility for users relying on screen readers.

/>
</a>
<nav class="nav">
<a
href="#"
class="box box-1 is-active"
>
Apple
</a>

<a
href="#"
class="box box-2"
>
Samsung
</a>

<a
href="#"
class="box box-3"
>
Smartphones
</a>

<a
href="#"
class="box box-4"
data-qa="hover"
>
Laptops & Computers
</a>

<a
href="#"
class="box box-5"
>
Gadgets
</a>

<a
href="#"
class="box box-6"
>
Tablets
</a>

<a
href="#"
class="box box-7"
>
Photo
</a>

<a
href="#"
class="box box-8"
>
Video
Comment on lines +35 to +99

Choose a reason for hiding this comment

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

The href attributes in the <a> tags are placeholders ("#"). Ensure these are updated to meet the task's functional requirements by linking to the appropriate pages or sections.

</a>
</nav>
</header>
</body>
</html>
99 changes: 99 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,102 @@
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Roboto, Arial, sans-serif;
background-color: grey;
}

:root {
--blue-color: #00acdc;
}

.nav {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
line-height: 60px;
height: 60px;
margin-right: 50px;

Choose a reason for hiding this comment

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

The margin-right in the .nav class contradicts the requirement for the header to stretch the full page width without horizontal margins. Consider removing or adjusting this margin to meet the layout requirements.

}

@media (width: 1200px) {
.img-link {
margin-right: 419px;
}
}

@media (width: 1024px) {
.img-link {
margin-right: 243px;
Comment on lines +25 to +31

Choose a reason for hiding this comment

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

The margin-right in the .img-link class within media queries contradicts the requirement for the header to stretch the full page width without horizontal margins. Adjust these margins to ensure compliance with the layout requirements.

}
}

.header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
background-color: white;
text-transform: uppercase;
height: 60px;
}

.img {
display: flex;
justify-content: center;
align-items: center;
width: 40px;
height: 40px;
margin-top: 10px;
margin-bottom: 10px;
}

.img-link {
padding-left: 50px;

Choose a reason for hiding this comment

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

The padding-left in the .img-link class might prevent the content from being centered vertically. Consider adjusting this padding to ensure the content is centered as required.

}

.box {
font-family: Roboto, sans-serif;
font-size: 12px;
text-align: center;
text-underline-position: from-font;
text-decoration: none;
font-weight: 500;
color: #000;
margin-right: 20px;
flex-grow: 0;
flex-shrink: 1;
white-space: nowrap;
}

.box-8 {
margin: 0;
padding: 0;
}

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

.is-active {
position: relative;
color: var(--blue-color);
display: flex;
justify-content: center;
align-items: center;
text-decoration: none;
}

.is-active::after {
content: '';
position: absolute;
bottom: -0.2px;
left: 0;
right: 0;
margin: 0 auto;
width: 37px;
height: 4px;
background-color: var(--blue-color);
border-radius: 8px;
}
Loading