-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
base: master
Are you sure you want to change the base?
Develop #5750
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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="#" | ||
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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
removeActiveClass(); | ||
link.classList.add('is-active'); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,82 @@ | ||
body { | ||
:root { | ||
--blue-color: #00acdc; | ||
} | ||
|
||
* { | ||
margin: 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
} |
There was a problem hiding this comment.
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.