Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
cementix committed Dec 18, 2024
1 parent f2d4745 commit 17968c3
Show file tree
Hide file tree
Showing 3 changed files with 257 additions and 11 deletions.
19 changes: 10 additions & 9 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,15 +28,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://cementix.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://cementix.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)
51 changes: 50 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,62 @@
http-equiv="X-UA-Compatible"
content="ie=edge"
/>
<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: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"
/>
<title>Moyo header</title>
<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>
<ul>
<li>
<a
href="/apple"
class="is-active"
>
Apple
</a>
</li>
<li><a href="/samsung">Samsung</a></li>
<li><a href="/smartphones">Smartphones</a></li>
<li>
<a
href="/laptops"
data-qa="hover"
>
Laptops & Computers
</a>
</li>
<li><a href="/gadgets">Gadgets</a></li>
<li><a href="/tablets">Tablets</a></li>
<li><a href="/photo">Photo</a></li>
<li><a href="/video">Video</a></li>
</ul>
</nav>
</header>
</body>
</html>
198 changes: 197 additions & 1 deletion src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,199 @@
body {
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
margin: 0;
padding: 0;
border: 0;
font-family: Roboto, serif;
font-size: 100%;
vertical-align: baseline;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

body {
line-height: 1;

--link-color: #00acdc;
}

ol,
ul {
list-style: none;
}

blockquote,
q {
quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
content: '';
content: none;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 50px;
}

ul {
list-style: none;
position: relative;
display: flex;
}

li {
position: relative;
margin: 0 10px;
}

ul li:first-child {
margin-left: 0;
}

ul li:last-child {
margin-right: 0;
}

a {
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 500;
text-transform: uppercase;
height: 60px;
text-decoration: none;
color: black;
}

a:hover {
color: var(--link-color);
}

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

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

.logo img {
width: 100%;
height: auto;
}

.logo {
display: flex;
align-items: center;
}

0 comments on commit 17968c3

Please sign in to comment.