Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 11 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ 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 the `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://Kindacid.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://Kindacid.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.

- [ ] Header height is set in 1 place (for the links)
- [ ] Content is vertically centered (for any header height)
- [ ] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [ ] Logo is an image wrapped with a link
- [ ] **CSS Variable** is used for a blue color
- [ ] Pseudo-element is used for a blue line below the active link
- [ ] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
- [x] Header height is set in 1 place (for the links)
- [x] Content is vertically centered (for any header height)
- [x] CSS is used to show all letters in Uppercase (don't type them in HTML)
- [x] Logo is an image wrapped with a link
- [x] **CSS Variable** is used for a blue color
- [x] Pseudo-element is used for a blue line below the active link
- [x] Code follows all the [Code Style Rules ❗️](./checklist.md)
- [x] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
111 changes: 110 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,122 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>

<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
Comment thread
Kindacid marked this conversation as resolved.
href="https://fonts.gstatic.com"
crossorigin="anonymous"
Comment thread
Kindacid marked this conversation as resolved.
/>
<link
Comment thread
Kindacid marked this conversation as resolved.
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
rel="stylesheet"
/>
Comment thread
Kindacid marked this conversation as resolved.

Comment thread
Kindacid marked this conversation as resolved.
<title>Moyo header</title>
<link
rel="stylesheet"
href="./style.css"
/>
</head>
Comment thread
Kindacid marked this conversation as resolved.
<body>
Comment thread
Kindacid marked this conversation as resolved.
<h1>Moyo header</h1>
<header>
<div class="container">
<div class="logo">
<a href="/">
<img
src="images/logo.png"
alt="Moyo logo"
Comment thread
Kindacid marked this conversation as resolved.
/>
</a>
</div>
Comment thread
Kindacid marked this conversation as resolved.

<nav>
<ul class="nav">
<li class="nav__list">
Comment thread
Kindacid marked this conversation as resolved.
Outdated
<a
href="#"
Comment thread
Kindacid marked this conversation as resolved.
class="nav-link is-active"
>
Apple
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
>
Samsung
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
Comment thread
Kindacid marked this conversation as resolved.
>
Comment thread
Kindacid marked this conversation as resolved.
Smartphones
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
>
Gadgets
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
>
Tablets
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
>
Photo
</a>
</li>
<li class="nav__list">
<a
href="#"
class="nav-link"
>
Video
</a>
</li>
</ul>
</nav>
</div>
</header>

<script>
const links = document.querySelectorAll('.nav-link');

links.forEach((link) => {
link.addEventListener('click', () => {
document
.querySelector('.nav-link.is-active')
.classList.remove('is-active');
link.classList.add('is-active');
});
});
</script>
</body>
</html>
66 changes: 66 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,69 @@
body {
margin: 0;
box-sizing: border-box;
font-family: Roboto, sans-serif;
font-weight: 500;
font-size: 12px;
}

header {
Comment thread
Kindacid marked this conversation as resolved.
Outdated
background-color: #fff;
height: 60px;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
}

.container {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 60px;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
position: relative;
}

.logo {
margin: 10px 0 10px 50px;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
}

.nav {
display: flex;
list-style: none;
margin: 12px 0 13px;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
padding: 0;
}

.nav__list {
display: flex;
list-style: none;
}
Comment thread
Kindacid marked this conversation as resolved.
Outdated

.nav-link {
display: flex;
align-items: center;
justify-content: center;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
text-decoration: none;
color: #000;
text-transform: uppercase;
margin: 10px;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
}

.nav-link:hover {
color: #00acdc;
Comment thread
Kindacid marked this conversation as resolved.
Outdated
}
Comment thread
Kindacid marked this conversation as resolved.
Outdated

.nav__list:last-child .nav-link {
margin-right: 50px;
}

.nav-link.is-active {
Comment thread
Kindacid marked this conversation as resolved.
color: #00acdc;
}

.nav-link.is-active::after {
content: '';
position: absolute;
bottom: 0;
width: 37px;
height: 4px;
border-radius: 8px;
background-color: #00acdc;
}
Loading