body{
background: #ccc;
}
.overlay_circle{
width: 30px;
height: 30px;
border-radius:40px;
background: #666;
position: absolute;
right: 5%;
top: 15px;
transition: .3s;
&.active{
width: 100%;
height: 100%;
right: 0px;
top: 0px;
border-radius: 0px;
}
&.active + .search{
width: 90%;
border-radius: 3px;
i{
margin-right: 24px;
}
input{
display: inline-block;
opacity: 1;
transition: .6s;
}
}
}
.search{
width: 50px;
height: 50px;
top: 10px;
right: 4%;
position: absolute;
background: white;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
border-radius: 40px;
display: flex;
transition: .3s;
i{
margin: auto;
font-size: 26px;
}
input{
opacity: 0;
position: absolute;
top: 4px;
font-family: 'Lato';
border: none;
outline: none;
margin-left: 8px;
padding: 12px;
border-radius: 3px;
font-size: 15px;
color: #333;
transition: .1s;
}
}
.results{
margin-top: 80px;
}
.result{
width: 90%;
margin: 0 auto;
height: 50px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
background: white;
border-radius: 3px;
margin-top: 12px;
transition: .0s;
&:hover{
background: #e4e4e4;
box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
transition: .2s;
}
&:active{
background: #a4a4a4;
box-shadow: none;
}
}
@for $i from 1 to 15 {
.result:nth-child(#{$i}) { animation-delay: $i * 0.05s; }
}
View Compiled
$('.overlay_circle').click(function(){
$(this).removeClass('active');
$('.result').remove();
})
$('.search').click(function(){
$('.overlay_circle').addClass('active');
appendResults();
});
function appendResults(){
$('.result').remove();
for(var i=0; i<10; i++){
$('.results').append('<div class="animated fadeInUp result"></div>')
}
}