Хорошо, работайте с эффектом, основываясь на том, что у вас уже есть.
var McButton = $("[data=hamburger-menu]");
var McBar1 = McButton.find("b:nth-child(1)");
var McBar2 = McButton.find("b:nth-child(2)");
var McBar3 = McButton.find("b:nth-child(3)");
McButton.click( function() {
$(this).toggleClass("active");
if (McButton.hasClass("active")) {
McBar1.velocity({ top: "50%" }, {duration: 200, easing: "swing"});
McBar3.velocity({ top: "50%" }, {duration: 200, easing: "swing"})
.velocity({rotateZ:"90deg"}, {duration: 800, delay: 200, easing: [500,20] });
McButton.velocity({rotateZ:"135deg"}, {duration: 800, delay: 200, easing: [500,20] });
} else {
McButton.velocity("reverse");
McBar3.velocity({rotateZ:"0deg"}, {duration: 800, easing: [500,20] })
.velocity({ top: "100%" }, {duration: 200, easing: "swing"});
McBar1.velocity("reverse", {delay: 800});
}
});
/* Global Styles */
body {
margin: 0;
padding: 0;
background-color: hsl(355, 75%, 56%);
}
/* Hamburger Menu */
.McButton {
position: absolute;
top: 50%;
left: 50%;
margin-left: -22px;
margin-top: -22px;
width: 44px;
height: 33px;
cursor: pointer;
}
.McButton b {
position: absolute;
left: 0;
width: 44px;
height: 3px;
background-color: white;
}
.McButton b:nth-child(1) {
top: 0;
}
.McButton b:nth-child(2) {
top: 50%;
}
.McButton b:nth-child(3) {
top: 100%;
}
/* McButton */
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/velocity/1.2.2/velocity.min.js"></script>
<!-- Hamburger Menu -->
<a class="McButton" data="hamburger-menu">
<b></b>
<b></b>
<b></b>
</a>