Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
202 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="./styles.css" /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;500;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<title>YardSale: tienda online de cosas chéveres</title> | ||
</head> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;500;700&display=swap" rel="stylesheet"> | ||
<style> | ||
:root { | ||
--white: #fff; | ||
--black: #000; | ||
--very-light-pink: #c7c7c7; | ||
--text-input-field: #f7f7f7; | ||
--hospital-green: #acd9b2; | ||
} | ||
<body> | ||
<nav> | ||
<img src="../assets/icons/icon_menu.svg" alt="menu" class="menu" /> | ||
|
||
body { | ||
font-family: 'Quicksand', sans-serif; | ||
} | ||
</style> | ||
</head> | ||
<div class="navbar-left"> | ||
<img src="../assets/logos/logo_yard_sale.svg" alt="logo" class="logo" /> | ||
|
||
<body> | ||
<ul> | ||
<li> | ||
<a href="/">All</a> | ||
</li> | ||
<li> | ||
<a href="/">Clothes</a> | ||
</li> | ||
<li> | ||
<a href="/">Electronics</a> | ||
</li> | ||
<li> | ||
<a href="/">Furnitures</a> | ||
</li> | ||
<li> | ||
<a href="/">Toys</a> | ||
</li> | ||
<li> | ||
<a href="/">Others</a> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
</body> | ||
<div class="navbar-right"> | ||
<ul> | ||
<li class="navbar-email">platzi@example.com</li> | ||
<li class="navbar-shopping-cart"> | ||
<img | ||
src="../assets/icons/icon_shopping_cart.svg" | ||
alt="shopping cart" | ||
/> | ||
<div>2</div> | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
</html> | ||
<div class="desktop-menu inactive"> | ||
<ul> | ||
<li><a href="/" class="title">My order</a></li> | ||
<li><a href="/" class="title">My account</a></li> | ||
<li><a href="/" class="title">Sign out</a></li> | ||
</ul> | ||
</div> | ||
</nav> | ||
|
||
<script src="./main.js"></script> | ||
r | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const menuEmail = document.querySelector(".navbar-email"); | ||
const desktopMenu = document.querySelector(".desktop-menu"); | ||
|
||
menuEmail.addEventListener("click", toggleDesktopMenu); | ||
|
||
function toggleDesktopMenu() { | ||
desktopMenu.classList.toggle("inactive"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
:root { | ||
--white: #ffffff; | ||
--black: #000000; | ||
--very-light-pink: #c7c7c7; | ||
--text-input-field: #f7f7f7; | ||
--hospital-green: #acd9b2; | ||
--sm: 14px; | ||
--md: 16px; | ||
--lg: 18px; | ||
} | ||
body { | ||
margin: 0; | ||
font-family: "Quicksand", sans-serif; | ||
} | ||
|
||
.inactive { | ||
display: none; | ||
} | ||
|
||
nav { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 0 24px; | ||
border-bottom: 1px solid var(--very-light-pink); | ||
} | ||
.menu { | ||
display: none; | ||
} | ||
.logo { | ||
width: 100px; | ||
} | ||
.navbar-left ul, | ||
.navbar-right ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
display: flex; | ||
align-items: center; | ||
height: 60px; | ||
} | ||
.navbar-left { | ||
display: flex; | ||
} | ||
.navbar-left ul { | ||
margin-left: 12px; | ||
} | ||
.navbar-left ul li a, | ||
.navbar-right ul li a { | ||
text-decoration: none; | ||
color: var(--very-light-pink); | ||
border: 1px solid var(--white); | ||
padding: 8px; | ||
border-radius: 8px; | ||
} | ||
.navbar-left ul li a:hover, | ||
.navbar-right ul li a:hover { | ||
border: 1px solid var(--hospital-green); | ||
color: var(--hospital-green); | ||
} | ||
.navbar-email { | ||
cursor: pointer; | ||
color: var(--very-light-pink); | ||
font-size: var(--sm); | ||
margin-right: 12px; | ||
} | ||
.navbar-shopping-cart { | ||
position: relative; | ||
} | ||
.navbar-shopping-cart div { | ||
width: 16px; | ||
height: 16px; | ||
background-color: var(--hospital-green); | ||
border-radius: 50%; | ||
font-size: var(--sm); | ||
font-weight: bold; | ||
position: absolute; | ||
top: -6px; | ||
right: -3px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.desktop-menu { | ||
position: absolute; | ||
top: 60px; | ||
right: 60px; | ||
background: var(--white); | ||
width: 100px; | ||
height: auto; | ||
border: 1px solid var(--very-light-pink); | ||
border-radius: 6px; | ||
padding: 20px 20px 0 20px; | ||
} | ||
.desktop-menu ul { | ||
list-style: none; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.desktop-menu ul li { | ||
text-align: end; | ||
} | ||
.desktop-menu ul li:nth-child(1), | ||
.desktop-menu ul li:nth-child(2) { | ||
font-weight: bold; | ||
} | ||
.desktop-menu ul li:last-child { | ||
padding-top: 20px; | ||
border-top: 1px solid var(--very-light-pink); | ||
} | ||
.desktop-menu ul li:last-child a { | ||
color: var(--hospital-green); | ||
font-style: var(--sm); | ||
} | ||
.desktop-menu ul li a { | ||
display: inline-block; | ||
color: var(--black); | ||
text-decoration: none; | ||
margin-bottom: 20px; | ||
} | ||
@media (max-width: 640px) { | ||
.menu { | ||
display: block; | ||
} | ||
.navbar-left ul { | ||
display: none; | ||
} | ||
.navbar-email { | ||
display: none; | ||
} | ||
} |