A Pen by Blaz Kemperle on CodePen.
Created
August 19, 2021 12:53
-
-
Save prashant2k15/5782acd6fdd2431fcb8f2e8f0204b61c to your computer and use it in GitHub Desktop.
Fancy menu
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
<div class="container"> | |
<button class="menu__btn"> | |
<span class="menu__label">MENU</span> | |
<div class="menu--hidden"> | |
<div class="menu__bg-layer menu__bg-layer-2"></div> | |
<div class="menu__bg-layer menu__bg-layer-1"></div> | |
<div class="menu__container"> | |
<span class="menu__title">Main menu</span> | |
<ul class="menu__list"> | |
<li class="menu__item"><a href="">Lorem ipsum</a></li> | |
<li class="menu__item"><a href="">Sin dolor habet</a></li> | |
<li class="menu__item"><a href="">Maxima experienca</a></li> | |
<li class="menu__item"><a href="">Lat in vodis</a></li> | |
<li class="menu__item"><a href="">Halamber nut</a></li> | |
</ul> | |
</div> | |
</div> | |
</button> | |
<div class="content"> | |
<h1>Ut enim ad minim veniam</h1> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> | |
</div> | |
</div> |
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
@import url(https://fonts.googleapis.com/css?family=Space+Mono:400,700); | |
body { | |
background: #efefef; | |
font-family: "Space Mono"; | |
font-weight:400; | |
color: #555; | |
} | |
input, button { | |
font-family: "Space Mono"; | |
font-size:1em; | |
} | |
a {text-decoration: none;color:inherit;} | |
.container { | |
transition: all 0.2s cubic-bezier(.7,.2,.17,1); | |
box-shadow: 0 0 2px hsla(0,0%,0%,0.1); | |
overflow:hidden; | |
position: relative; | |
margin:5% 10%; | |
height: 400px; | |
background: hsla(0,0%,100%,0.5); | |
} | |
.container:hover { | |
background: hsla(0,0%,100%,1); | |
transform: scale(1.02); | |
box-shadow: 0 46px 12px -16px hsla(0,0%,0%,0.05); | |
} | |
.content { | |
padding: 5%; | |
} | |
h1 {color:#16DB93;} | |
p {color: #777;} | |
/* --- menu --- */ | |
.menu__btn { | |
float:left; | |
background: none; | |
border:none; | |
padding: 1em 0.5em; | |
} | |
.menu__label { | |
writing-mode: vertical-lr; | |
font-size: 0.8em; | |
letter-spacing: 0.1em; | |
font-weight:bold; | |
color: #16DB93; | |
} | |
.menu__title {font-size:1.3em;} | |
.menu__container { | |
transition: all 0.4s 0.3s cubic-bezier(.4,0,.17,1); | |
transform: translateX(-20em); | |
padding: 1em; | |
color:white; | |
font-size:1em; | |
top:0; | |
left:40%; | |
font-weight:bold; | |
text-align:left; | |
opacity:0; | |
visibility:hidden; | |
position:absolute; | |
} | |
.menu__list { | |
padding:0; | |
margin-top:2em; | |
} | |
.menu__item { | |
transition: all 0.2s; | |
list-style: none; | |
} | |
.menu__item:hover { | |
color:black; | |
} | |
.menu__item:before, | |
.menu__item:last-child:after { | |
content:''; | |
display:block; | |
width:100px; | |
height:1px; | |
background: hsla(0,0%,100%,0.5); | |
margin: 1em 0; | |
} | |
.menu__bg-layer { | |
transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1); | |
border-radius:50%; | |
opacity:0; | |
position:absolute; | |
transform: translate(-50%, -50%); | |
background: #16DB93; | |
height:0; | |
width:0; | |
} | |
.menu__btn:hover .menu__container { | |
transform: translateX(0); | |
transition-delay:0; | |
width:100%; | |
heigth:100%; | |
visibility:visible; | |
opacity:1; | |
} | |
.menu__btn:hover .menu__bg-layer { | |
padding-bottom: 250%; | |
width:250%; | |
opacity:1; | |
} | |
.menu__btn:hover .menu__bg-layer-2 { | |
background: #FAFF7F; | |
} | |
.menu__btn:hover .menu__bg-layer-1 { | |
transition-delay:0.2s; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment