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

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

Develop #5750

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
14 changes: 0 additions & 14 deletions backstop_data/engine_scripts/cookies.json

This file was deleted.

Binary file removed backstop_data/engine_scripts/imageStub.jpg
Binary file not shown.
39 changes: 0 additions & 39 deletions backstop_data/engine_scripts/puppet/clickAndHoverHelper.js

This file was deleted.

29 changes: 0 additions & 29 deletions backstop_data/engine_scripts/puppet/loadCookies.js

This file was deleted.

3 changes: 0 additions & 3 deletions backstop_data/engine_scripts/puppet/onBefore.js

This file was deleted.

6 changes: 0 additions & 6 deletions backstop_data/engine_scripts/puppet/onReady.js

This file was deleted.

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://olkowskak.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://olkowskak.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 @@ -12,11 +12,111 @@
/>
<title>Moyo header</title>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap"
rel="stylesheet"
href="./style.css"
/>
<link
rel="stylesheet"
href="style.css"
/>
</head>
<body>
<h1>Moyo header</h1>
<header>
<a
href="#"

Choose a reason for hiding this comment

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

The href="#" attribute is used as a placeholder. If these links are intended to navigate to specific sections or pages, consider replacing # with the actual URLs or section IDs.

class="logo"
>
<img
src="./images/logo.png"
alt="logo"
/>
</a>

<nav class="nav">
<ul class="list">
<li class="list-item">
<a
href="#apple"
class="link is-active"
>
Apple
</a>
</li>
<li class="list-item">
<a
href="#samsung"
class="link"
>
Samsung
</a>
</li>
<li class="list-item">
<a
href="#smartphones"
class="link"
>
Smartphones
</a>
</li>
<li class="list-item">
<a
href="#laptopscomputers"
class="link"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li class="list-item">
<a
href="#gadgets"
class="link"
>
Gadgets
</a>
</li>
<li class="list-item">
<a
href="#tablets"
class="link"
>
Tablets
</a>
</li>
<li class="list-item">
<a
href="#photo"
class="link"
>
Photo
</a>
</li>
<li class="list-item">
<a
href="#video"
class="link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
<script>
const navLinks = document.querySelectorAll('.list .link');

function removeActiveClass() {
navLinks.forEach((link) => link.classList.remove('is-active'));
}

navLinks.forEach((link) => {
link.addEventListener('click', (event) => {
event.preventDefault();

Choose a reason for hiding this comment

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

The event.preventDefault() method is used here, which prevents the default action of the link. If the intention is to navigate to different sections or pages, you might want to remove this line or adjust the logic to allow navigation.


removeActiveClass();
link.classList.add('is-active');
});
});
</script>
</body>
</html>
81 changes: 80 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,82 @@
body {
:root {
--blue-color: #00acdc;
}

* {
margin: 0;

Choose a reason for hiding this comment

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

The universal selector (*) is setting a background color of #fff for all elements. This might override background colors for elements where a different background is desired. Consider applying this style more selectively if needed.

padding: 0;
background-color: #fff;
}

body {
font-family: Roboto, sans-serif;
font-weight: 500;

Choose a reason for hiding this comment

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

The font-weight is set to 500 for the entire body. Ensure that this is the desired weight for all text elements, as it might not be suitable for all text styles, such as headings or emphasized text.

font-size: 12px;
line-height: 14px;
}

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

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

.nav {
display: flex;
position: relative;
align-items: center;
margin-left: auto;
height: 60px;
}

.list {
display: flex;
align-items: center;
list-style-type: none;
}

.link {
display: flex;
align-items: center;
justify-content: center;
height: 60px;
margin: 0 10px;
color: #000;
text-decoration: none;
text-transform: uppercase;
}

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

.list-item:first-child .link {
margin-left: 0;
}

.list-item:last-child .link {
margin-right: 0;
}

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

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