MENÚ ESQUINA
Desplegar el menú desde la esquina con forma de circulo.
Este efecto se logra mediante el uso de la propiedad Clip path y el atributo circle. Da click en el botón para ver una página de ejemplo.
<header>
<div class="header-logo"><img src="imagenes/logo.png"></div>
<i id="menu-nav" class="far fa-bars"></i>
</header>
<nav>
<div class="btn-Cerrar">X </div>
<div class="ctn-nav">
<li><a href="">Opcion 1</a></li>
<li><a href="">Opcion 2</a></li>
<li><a href="">Opcion 3</a></li>
<li><a href="">Opcion 4</a></li>
<li><a href="">Opcion 5</a></li>
</div>
</nav>
header{
position: fixed;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
background: #091D36);
z-index: 100;
}
.header-logo{
width: 8%;
min-width: 100px;
margin-left: 1rem;
}
.header-logo img{
width: 100%;
}
#menu-nav{
font-weight: bold;
font-size: 1.5rem;
color: #28DB18;
margin-right: 2rem;
}
nav{
z-index: 1000;
width: 100%;
height: 100vh;
position: fixed;
background: #C2D2E9;
clip-path: circle(0.0% at 100% 0);
transition: 2s;
}
.nav-visible{
clip-path: circle(141.2% at 100% 0);
}
.ctn-nav{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100%;
}
.ctn-nav li{
list-style: none;
margin: 10px 0;
width: 50%;
height: 50px;
text-align: center;
line-height: 50px;
}
.ctn-nav li a{
text-decoration: none;
color: #091D36;
}
.ctn-nav li:hover{
background: #091D36;
}
.ctn-nav li:hover a{
color: #fff;
}
.btn-Cerrar{
position: absolute;
right: 35px;
top: 35px;
width: 30px;
height: 30px;
background: #28DB18;
color: #fff;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
function muestraMenu(evento) {
evento.preventDefault();
evento.stopPropagation();
document.querySelector("nav").classList.toggle("nav-visible");
}
function ocultaMenu(evento) {
evento.preventDefault();
document.querySelector("nav").classList.remove("nav-visible");
}
document.querySelector("#menu-nav").addEventListener("click", muestraMenu);
document.querySelector(".btn-Cerrar").addEventListener("click", ocultaMenu);
MENÚ EN FLOR
Menu desplegable que simula una flor, en el podemos poner palabras o iconos.
Este efecto es muy implementado con js pero si aun no eres muy bueno dominando, esta opcion es para ti ya que solo usa html y css.
El efecto "flor" se logra gracias a los "hover" y "nth-child"
<nav class="menu">
<div class="menu2">
<a href="menus.html">Volver</a>
</div>
<input type="checkbox" href="#" class="menu-open" name="menu-open" id="menu-open" />
<label class="menu-open-button" for="menu-open">
<span class="lines line-1"></span>
<span class="lines line-2"></span>
<span class="lines line-3"></span>
</label>
<a href="#" class="menu-item blue"> <i class="fa fa-anchor">Opción1</i> </a>
<a href="#" class="menu-item green"> <i class="fa fa-coffee">Opción2</i> </a>
<a href="#" class="menu-item red"> <i class="fa fa-heart"<Opción3</i< </a>
<a href="#" class="menu-item purple"> <i class="fa fa-microphone">Opción4</i< </a>
<a href="#" class="menu-item orange"> <i class="fa fa-star">Opción5</i> </a>
<a href="#" class="menu-item lightblue"> <i class="fa fa-diamond"<Opción6</i> </a>
</nav>
.menu-item,
.menu-open-button {
background: #EEEEEE;
border-radius: 100%;
width: 80px;
height: 80px;
margin-left: -40px;
position: absolute;
color: #FFFFFF;
text-align: center;
line-height: 80px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
-webkit-transition: -webkit-transform ease-out 200ms;
transition: -webkit-transform ease-out 200ms;
transition: transform ease-out 200ms;
transition: transform ease-out 200ms, -webkit-transform ease-out 200ms;
}
.menu-open {
display: none;
}
.lines {
width: 25px;
height: 3px;
background: #596778;
display: block;
position: absolute;
top: 50%;
left: 50%;
margin-left: -12.5px;
margin-top: -1.5px;
-webkit-transition: -webkit-transform 200ms;
transition: -webkit-transform 200ms;
transition: transform 200ms;
transition: transform 200ms, -webkit-transform 200ms;
}
.line-1 {
-webkit-transform: translate3d(0, -8px, 0);
transform: translate3d(0, -8px, 0);
}
.line-2 {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.line-3 {
-webkit-transform: translate3d(0, 8px, 0);
transform: translate3d(0, 8px, 0);
}
.menu-open:checked + .menu-open-button .line-1 {
-webkit-transform: translate3d(0, 0, 0) rotate(45deg);
transform: translate3d(0, 0, 0) rotate(45deg);
}
.menu-open:checked + .menu-open-button .line-2 {
-webkit-transform: translate3d(0, 0, 0) scale(0.1, 1);
transform: translate3d(0, 0, 0) scale(0.1, 1);
}
.menu-open:checked + .menu-open-button .line-3 {
-webkit-transform: translate3d(0, 0, 0) rotate(-45deg);
transform: translate3d(0, 0, 0) rotate(-45deg);
}
.menu {
margin: auto;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 80px;
height: 80px;
text-align: center;
box-sizing: border-box;
font-size: 26px;
}
/* .menu-item {
transition: all 0.1s ease 0s;
} */
.menu-item:hover {
background: #EEEEEE;
color: #3290B1;
}
.menu-item:nth-child(3) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(4) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(5) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(6) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(7) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(8) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-item:nth-child(9) {
-webkit-transition-duration: 180ms;
transition-duration: 180ms;
}
.menu-open-button {
z-index: 2;
-webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
-webkit-transition-duration: 400ms;
transition-duration: 400ms;
-webkit-transform: scale(1.1, 1.1) translate3d(0, 0, 0);
transform: scale(1.1, 1.1) translate3d(0, 0, 0);
cursor: pointer;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
}
.menu-open-button:hover {
-webkit-transform: scale(1.2, 1.2) translate3d(0, 0, 0);
transform: scale(1.2, 1.2) translate3d(0, 0, 0);
}
.menu-open:checked + .menu-open-button {
-webkit-transition-timing-function: linear;
transition-timing-function: linear;
-webkit-transition-duration: 200ms;
transition-duration: 200ms;
-webkit-transform: scale(0.8, 0.8) translate3d(0, 0, 0);
transform: scale(0.8, 0.8) translate3d(0, 0, 0);
}
.menu-open:checked ~ .menu-item {
-webkit-transition-timing-function: cubic-bezier(0.935, 0, 0.34, 1.33);
transition-timing-function: cubic-bezier(0.935, 0, 0.34, 1.33);
}
.menu-open:checked ~ .menu-item:nth-child(3) {
transition-duration: 180ms;
-webkit-transition-duration: 180ms;
-webkit-transform: translate3d(0.08361px, -104.99997px, 0);
transform: translate3d(0.08361px, -104.99997px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(4) {
transition-duration: 280ms;
-webkit-transition-duration: 280ms;
-webkit-transform: translate3d(90.9466px, -52.47586px, 0);
transform: translate3d(90.9466px, -52.47586px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(5) {
transition-duration: 380ms;
-webkit-transition-duration: 380ms;
-webkit-transform: translate3d(90.9466px, 52.47586px, 0);
transform: translate3d(90.9466px, 52.47586px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(6) {
transition-duration: 480ms;
-webkit-transition-duration: 480ms;
-webkit-transform: translate3d(0.08361px, 104.99997px, 0);
transform: translate3d(0.08361px, 104.99997px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(7) {
transition-duration: 580ms;
-webkit-transition-duration: 580ms;
-webkit-transform: translate3d(-90.86291px, 52.62064px, 0);
transform: translate3d(-90.86291px, 52.62064px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(8) {
transition-duration: 680ms;
-webkit-transition-duration: 680ms;
-webkit-transform: translate3d(-91.03006px, -52.33095px, 0);
transform: translate3d(-91.03006px, -52.33095px, 0);
}
.menu-open:checked ~ .menu-item:nth-child(9) {
transition-duration: 780ms;
-webkit-transition-duration: 780ms;
-webkit-transform: translate3d(-0.25084px, -104.9997px, 0);
transform: translate3d(-0.25084px, -104.9997px, 0);
}
.blue {
background-color: #669AE1;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.blue:hover {
color: #669AE1;
text-shadow: none;
}
.green {
background-color: #70CC72;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.green:hover {
color: #70CC72;
text-shadow: none;
}
.red {
background-color: #FE4365;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.red:hover {
color: #FE4365;
text-shadow: none;
}
.purple {
background-color: #C49CDE;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.purple:hover {
color: #C49CDE;
text-shadow: none;
}
.orange {
background-color: #FC913A;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.orange:hover {
color: #FC913A;
text-shadow: none;
}
.lightblue {
background-color: #62C2E4;
box-shadow: 3px 3px 0 0 rgba(0, 0, 0, 0.14);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.12);
}
.lightblue:hover {
color: #62C2E4;
text-shadow: none;
}
.credit {
margin: 24px 20px 120px 0;
text-align: right;
color: #EEEEEE;
}
.credit a {
padding: 8px 0;
color: #C49CDE;
text-decoration: none;
transition: all 0.3s ease 0s;
}
.credit a:hover {
text-decoration: underline;
}
MENÚ DESPLEGABLE
Menu desplegable, elegante e ideal cuando quieres darle un toque unico a tu pagina
Este efecto se logra gracias al "hover".
<nav>
<menu>
<menuitem id="demo1">
<a>desplegable </a>
<menu>
<menuitem> <a>NO </a> </menuitem>
<menuitem>
<a>desplehable </a>
<menu>
<menuitem> <a> 1 </a> </menuitem>
<menuitem> <a>2 </a> </menuitem>
<menuitem> <a> 3 </a> </menuitem>
<menuitem> <a>4>/a> </menuitem>
</menu>
</menuitem>
<menuitem> <a>desplegable </a> </menuitem>
<menuitem id="demo2">
<a>desplegable </a>
<menu>
<menuitem id="demo3">
<a>1 </a>
<menu>
<menuitem> <a> 1 </a> </menuitem>
<menuitem> <a> 2 </a> </menuitem>
<menuitem> <a </a> </menuitem>
</menu>
</menuitem>
<menuitem><a>4</a></menuitem>
</menu>
</menuitem>
</menu>
</menuitem>
<menuitem><a>No</a></menuitem>
</menu>
</nav>
<script src=""></script>
nav a:hover:before {
content: '';
top:0;left:0;
position:absolute;
background:rgba(0, 0, 0, 0.2);
width:100%;
height:100%;
}
nav > menu > menuitem > a + menu:after{
content: '';
position:absolute;
border:10px solid transparent;
border-top: 10px solid white;
left:12px;
top: -40px;
}
nav menuitem > menu > menuitem > a + menu:after{
content: '';
position:absolute;
border:10px solid transparent;
border-left: 10px solid white;
top: 20px;
left:-180px;
transition: opacity 0.6, transform 0s;
}
nav > menu > menuitem > menu > menuitem{
transition: transform 0.6s, opacity 0.6s;
transform:translateY(150%);
opacity:0;
}
nav > menu > menuitem:hover > menu > menuitem,
nav > menu > menuitem.hover > menu > menuitem{
transform:translateY(0%);
opacity: 1;
}
menuitem > menu > menuitem > menu > menuitem{
transition: transform 0.6s, opacity 0.6s;
transform:translateX(195px) translateY(0%);
opacity: 0;
}
menuitem > menu > menuitem:hover > menu > menuitem,
menuitem > menu > menuitem.hover > menu > menuitem{
transform:translateX(0) translateY(0%);
opacity: 1;
}
MENÚ EFECTO OVER
Gracias al "hover" y "nth-child" es que este efecto de desplazamiento es posible.
Sencillo pero muy bonito
<div class="menu">
<div class="label">PRESIONA</div>
<div class="spacer"></div>
<div class="item"><span>opcion1</span></div>
<div class="item"><span>opcion2</span></div>
<div class="item"><span>opcion3</span></div>
<div class="item"><span>opcion4</span></div>
<div class="item"><span>opcion5</span></div>
</div>
.menu:hover {
pointer-events: all;
}
.label {
border-radius: 15px;
width: 150px;
color: black;
background-color: #c2d2e9;
display: inline-block;
cursor: pointer;
pointer-events: all;
}
.spacer {
display: inline-block;
width: 80px;
margin-left: 15px;
margin-right: 15px;
vertical-align: middle;
cursor: pointer;
position: relative;
}
.spacer:before {
content: "";
position: absolute;
border-bottom: 1px solid #c2d2e9;
height: 1px;
width: 0%;
transition: width 0.25s ease;
transition-delay: 0.7s;
}
.item {
position: relative;
display: inline-block;
margin-right: 30px;
top: 10px;
opacity: 0;
transition: opacity 0.5s ease, top 0.5s ease;
transition-delay: 0;
}
span {
transition: color 0.5s ease;
}
.item:hover span {
color: #28db18;
}
.menu:hover .spacer:before {
width: 100%;
transition-delay: 0s;
}
.menu:hover .item {
opacity: 1;
top: 0px;
}
.item:nth-child(1) {
transition-delay: 0.45s;
}
.item:nth-child(2) {
transition-delay: 0.4s;
}
.item:nth-child(3) {
transition-delay: 0.35s;
}
.item:nth-child(4) {
transition-delay: 0.3s;
}
.item:nth-child(5) {
transition-delay: 0.25s;
}
.item:nth-child(6) {
transition-delay: 0.2s;
}
.item:nth-child(7) {
transition-delay: 0.15s;
}
.item:nth-child(8) {
transition-delay: 0.1s;
}
.item:nth-child(9) {
transition-delay: 0.05s;
}
.item:nth-child(10) {
transition-delay: 0s;
}
.menu:hover .item:nth-child(1) {
transition-delay: 0.25s;
}
.menu:hover .item:nth-child(2) {
transition-delay: 0.3s;
}
.menu:hover .item:nth-child(3) {
transition-delay: 0.35s;
}
.menu:hover .item:nth-child(4) {
transition-delay: 0.4s;
}
.menu:hover .item:nth-child(5) {
transition-delay: 0.45s;
}
.menu:hover .item:nth-child(6) {
transition-delay: 0.5s;
}
.menu:hover .item:nth-child(7) {
transition-delay: 0.55s;
}
.menu:hover .item:nth-child(8) {
transition-delay: 0.6s;
}
.menu:hover .item:nth-child(9) {
transition-delay: 0.65s;
}
.menu:hover .item:nth-child(10) {
transition-delay: 0.7s;
}