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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
18 changes: 9 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ 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://<gazebo88fire>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<gazebo88fire>.github.io/layout_moyo-header/report/html_report/)

Choose a reason for hiding this comment

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

Suggested change
- [DEMO LINK](https://<gazebo88fire>.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://<gazebo88fire>.github.io/layout_moyo-header/report/html_report/)
- [DEMO LINK](https://gazebo88fire.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://gazebo88fire.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)
- [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)
100 changes: 94 additions & 6 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,107 @@
<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"
/>
<meta
http-equiv="X-UA-Compatible"
content="ie=edge"
content="width=device-width, initial-scale=1.0"
/>
<title>Moyo header</title>
<link
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"

Choose a reason for hiding this comment

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

I think we don't need that many font sizes if you only use 3.

Suggested change
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"
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"

/>
</head>

Choose a reason for hiding this comment

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

Suggested change

<body>
<h1>Moyo header</h1>
<header class="header">
<div class="logo">
<a href="#">
<img
src="./images/logo.png"
alt="Moyo logo"
/>
</a>
</div>

<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
class="nav__link is-active"
href="#"
>
Apple
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Samsung
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Smartphones
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
data-qa="hover"
href="#"
>
Laptops & computers
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Gadgets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Tablets
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Photo
</a>
</li>
<li class="nav__item">
<a
class="nav__link"
href="#"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
75 changes: 75 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
body {
margin: 0;
}

* {
box-sizing: border-box;
}

Choose a reason for hiding this comment

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

Don't use * selector (it impacts performance), better use html or body tag.

image


html {
font-family: Roboto, sans-serif;
font-weight: 500;
font-style: normal;

Choose a reason for hiding this comment

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

Suggested change
font-style: normal;

It is default style

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

--main-color: #00acdc;
}

.header {
display: flex;
justify-content: space-between;
align-items: center;
padding-inline: 50px;
box-shadow: 0 2px 4px 0 #0000000d;
}

.nav__list {
display: flex;
list-style: none;
gap: 20px;
padding: 0;
margin: 0;
}

.nav__link {
position: relative;
display: flex;
align-items: center;

color: #000;
text-decoration: none;
height: 60px;

padding: 0;
margin: 0;

text-transform: uppercase;
font: inherit;
}

.nav__link:hover,
.is-active {
color: var(--main-color);
}

.nav__item {
margin-right: 20 px;

Choose a reason for hiding this comment

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

We don't need it and it is broken, please, remove
image

align-items: center;
}

.is-active::after {
content: '';
display: block;
position: absolute;
left: 0;
right: 0;
bottom: 0;

height: 4px;
background-color: var(--main-color);
border-radius: 8px;
}

/* .logo {
height: 40px;
width: 40px;
margin-left: 50px;
} */

Choose a reason for hiding this comment

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

Please, remove commented code before commit, to keep the code clean

Loading