Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>reto 3</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>

<header class="header">
<nav class="header__nav">
<div class="header__nav--left">
<div class="ico-burguer">
<a onclick="toogleMenu()" href="#"><img src="http://monsterbranding.com.mx/images/menu.png" alt="menu"> </a>
<ul id="menuEscondido">
<li><a href="#">inicio</a></li>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
<h2>Page Title</h2>
</div>
<div class="header__nav--right">
<ul>
<li><a href="#"><img src="http://monsterbranding.com.mx/images/heart-outline.png" alt="heart"></a></li>
<li><a onclick="searchForm()" href="#"><img src="http://monsterbranding.com.mx/images/search.png" alt="search"></a>

</li>
<li><a href="#"><img src="http://monsterbranding.com.mx/images/menu-vertical.png" alt="secondary-menu"></a></li>
</ul>
</div>
</nav>
</header>
<div class="search" id="search">
<input type="search" placeholder="buscar..">

</div>
<script src="menu.js"></script>
</body>
</html>
24 changes: 24 additions & 0 deletions menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// alert('si estoy')


function toogleMenu() {
// console.log('its working')
let menu = document.getElementById('menuEscondido')
if (menu.style.left === "-210px") {
menu.style.left = "0"
}
else {
menu.style.left = "-210px"

}
}

function searchForm() {
let search = document.getElementById('search')
if (search.style.top === "-67px") {
search.style.top = "67px"
}
else{
search.style.top = "-67px"
}
}
92 changes: 92 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
body {
padding: 0;
margin: 0;
height: calc(100vh - 200px);
}

.header {
background-color: #6221ea;
font-family: Arial, Helvetica, sans-serif;
z-index: 3;
}
.header__nav {
color: white;
display: flex;
justify-content: space-between;
}
.header__nav--left {
display: flex;
align-items: center;
position: relative;
}
.header__nav--left img {
width: 26px;
}
.header__nav--left a {
padding: 0 20px;
}
.ico-burguer ul {
position: absolute;
background-color: thistle;
height: 100vh;
padding-top: 30px;
margin-top: 19px;
padding-right: 30px;
list-style: none;
font-size: 16px;
font-weight: bold;
left: -210px;
transition: .3s;
margin-bottom: 0;
}
.ico-burguer ul a {
text-decoration: none;
color: #6221ea;
padding: 0 20px;
}
.ico-burguer ul li {
padding: 10px 20px;
}
.header__nav--left h2 {
padding: 0 20px;
}
.header__nav--right {
position: relative;
}
.header__nav--right ul {
display: flex;
list-style: none;
align-items: center;
justify-content: space-around;
}
.header__nav--right ul li {
padding: 0px 20px;
}
.search{
display: flex;
justify-content: center;
align-items: center;
width: 100%;
background: #6221ea;
position: absolute;
top: -67px;
transition: .5s;
z-index: 1;

}
.search input {
padding: 10px 20px;
margin: 10px;
width: 90%;
background-color: rgba(255, 255, 255, .5);
border: 1px solid white;
border-radius: 18px;
color: white;
outline: none;
}
::placeholder {
color: white;
}
.header__nav--right ul li img {
width: 26px;
}