Skip to content

Commit

Permalink
add task solution
Browse files Browse the repository at this point in the history
  • Loading branch information
MissDragi committed Dec 13, 2024
1 parent f2d4745 commit 21638a6
Show file tree
Hide file tree
Showing 4 changed files with 330 additions and 4 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ 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://MissDragi.github.io/layout_moyo-header/)
- [TEST REPORT LINK](https://MissDragi.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.

Expand Down
113 changes: 111 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,119 @@
<title>Moyo header</title>
<link
rel="stylesheet"
href="./style.css"
href="reset.css"
/>
<link
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@400;500;700&display=swap"
rel="stylesheet"
/>
</head>

<body>
<h1>Moyo header</h1>
<header class="header">
<a
href="index.html"
class="main_logo"
title="On main page"
>
<img
class="logo"
src="/src/images/logo.png"
width="40"
height="40"
alt="Moyo.png"
/>
</a>

<nav class="nav">
<ul class="nav__list">
<li class="nav__item">
<a
href="apple"
class="link is-active"
>
Apple
</a>
</li>

<li class="nav__item">
<a
href="samsung"
class="link"
>
Samsung
</a>
</li>

<li class="nav__item">
<a
href="smartphones"
class="link"
>
Smartphones
</a>
</li>

<li class="nav__item">
<a
class="link"
href="laptops&computers"
data-qa="hover"
>
Laptops & Computers
</a>
</li>

<li class="nav__item">
<a
href="gadgets"
class="link"
>
Gadgets
</a>
</li>

<li class="nav__item">
<a
href="tablets"
class="link"
>
Tablets
</a>
</li>

<li class="nav__item">
<a
href="photo"
class="link"
>
Photo
</a>
</li>

<li class="nav__item">
<a
href="video"
class="link"
>
Video
</a>
</li>
</ul>
</nav>
</header>
</body>
</html>
137 changes: 137 additions & 0 deletions src/reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/

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,
text {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font-style: inherit;
vertical-align: baseline;
white-space: normal;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
display: block;
}

body {
line-height: 1;
}

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;
}
80 changes: 80 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,83 @@
body {
--link-color: #00acdc;
--main-color: #000;
--header-color: #fff;

margin: 0;
font-family: Roboto, sans-serif;
font-weight: 500;
background-color: rgb(231, 231, 228);
}

header {
position: relative;
display: flex;
width: 100%;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
background-color: var(--header-color);
}

.main_logo {
display: flex;
width: 140px;
}

.logo {
display: block;
margin: auto;
}

.nav {
margin-right: 50px;
}

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

.nav__item {
margin-right: 20px;
}

.nav__item:last-child {
margin-right: 0;
}

.link {
position: relative;
text-decoration: none;
text-transform: uppercase;
color: var(--main-color);
line-height: 60px;
font-size: 12px;
display: inline-block;
}

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

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

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

.is-active::after {
content: '';
position: absolute;
color: #00acdc;
left: 0;
right: 0;
bottom: 0;
height: 4px;
border-radius: 4px;
background-color: var(--link-color);
}

0 comments on commit 21638a6

Please sign in to comment.