Skip to content
Open

Develop #7492

Show file tree
Hide file tree
Changes from 4 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
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ 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://pparys93.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://pparys93.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.
❗️ Copy this `Checklist` to the `Pull Request` description after links, and put `- [x]` before each pogint after you checked it.

- [ ] Header height is set in 1 place (for the links)
- [ ] Content is vertically centered (for any header height)
Expand All @@ -39,5 +39,5 @@ The page should match the design Pixel Perfect: all the sizes, colors and distan
- [ ] **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)
- [ ] The Google Fonts Configuration follows requirements.
![alt text](./assets/image.png)
102 changes: 101 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,108 @@
rel="stylesheet"
href="./style.css"
/>
<link
rel="preconnect"
href="https://fonts.googleapis.com"
/>
<link
rel="preconnect"
href="https://fonts.gstatic.com"
crossorigin="anonymous"
/>
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap"
rel="stylesheet"
/>
</head>
<body>
<h1>Moyo header</h1>
<header class="header">
<a
class="header__logo"
href="index.html"
>
<img
src="images/logo.png"
alt="Moyo logo"
/>
</a>

<nav class="header__nav">
<ul class="header__menu">
<li class="header__menu-item">
<a
href="#apple"
class="header__menu-link is-active"
>
Apple
</a>
</li>

<li class="header__menu-item">
<a
href="#samsung"
class="header__menu-link"
>
Samsung
</a>
</li>

<li class="header__menu-item">
<a
href="#smartphones"
class="header__menu-link"
>
Smartphones
</a>
</li>

<li class="header__menu-item">
<a
href="#laptops-computers"
data-qa="hover"
class="header__menu-link"
>
Laptops & computers
</a>
</li>

<li class="header__menu-item">
<a
href="#gadgets"
class="header__menu-link"
>
Gadgets
</a>
</li>

<li class="header__menu-item">
<a
href="#tablets"
class="header__menu-link"
>
Tablets
</a>
</li>

<li class="header__menu-item">
<a
href="#photo"
class="header__menu-link"
>
Photo
</a>
</li>

<li class="header__menu-item">
<a
href="#video"
class="header__menu-link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
65 changes: 65 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,68 @@
html {
--primary-color: #00acdc;
}

body {
margin: 0;
padding: 0;
font-family: Roboto, sans-serif;
font-size: 12px;
font-style: normal;
}

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

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

.header__menu {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}

.header__menu-link {
display: flex;
align-items: center;
justify-content: center;
height: 60px;
margin-left: 20px;
color: #000;
text-decoration: none;
text-transform: uppercase;
position: relative;
}

.header__menu-link:hover {
text-decoration: none;

Choose a reason for hiding this comment

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

This text-decoration: none; is redundant because this style is already applied in the .header__menu-link rule on line 41. It's good practice to avoid restating styles that are already inherited or applied.

color: var(--primary-color);
}

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

.is-active {
color: var(--primary-color);
}

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