Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Forked from anonymous/Another 'burger.markdown
Created December 11, 2015 13:07
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save CodeMyUI/c2e005d2581ec42c5a19 to your computer and use it in GitHub Desktop.
Save CodeMyUI/c2e005d2581ec42c5a19 to your computer and use it in GitHub Desktop.
Another 'burger
<a href="#toggle" class="hamburgler">
<div class="bun top"></div>
<div class="meat"></div>
<div class="bun bottom"></div>
</a>
$(document).ready(function(){
$('.hamburgler').click(function(e){
e.preventDefault();
$(this).toggleClass('no-hamburgler');
});
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
// Colors
$light: #FBBF40;
$dark: #CB4B1F;
$radius: 50px;
body{
background: $light;
text-align: center;
font-size: 200%;
color: $dark;
display: flex;
flex-direction: column;
height: 100%;
position: absolute;
width: 100%;
& > *{
margin: auto;
}
}
.hamburgler{
width: 150px;
height: 150px;
display: block;
transition: .3s ease all;
&.no-hamburgler{
transform: rotate(-45deg);
}
}
.bun,
.meat{
display: block;
width: 100%;
background: $dark;
height: 20%;
transition: .3s ease all;
border-radius: $radius;
}
.top{
.no-hamburgler & {
height: 38%;
width: 20%;
margin-left: 40%;
border-radius: $radius $radius 0 0;
}
}
.bottom{
.no-hamburgler & {
height: 38%;
width: 20%;
margin-left: 40%;
border-radius: 0 0 $radius $radius;
}
}
.meat{
margin: 20% 0;
.no-hamburgler &{
margin: 2% 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment