mobile trigger effect
/*============= JS ==============*/
$('.custom-menu-primary .hs-menu-wrapper').before('<div class="mobile-trigger"><span></span><span></span><span></span><span></span><span></span><span></span></div>');
/*============= CSS ==============*/
.mobile-trigger {
display: inline-block !important;
cursor: pointer;
position: absolute;
left: 15px;
top: 22px;
z-index: 9999999;
width: 34px;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .5s ease-in-out;
-moz-transition: .5s ease-in-out;
-o-transition: .5s ease-in-out;
transition: .5s ease-in-out;
height: 24px;
}
.mobile-trigger span {
display: block;
position: absolute;
height: 2px;
width: 50%;
background: #fff;
opacity: 1;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .3s ease-in-out;
-moz-transition: .3s ease-in-out;
-o-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.mobile-trigger span:nth-child(odd) {
left: 0;
}
.mobile-trigger span:nth-child(even) {
left: 50%;
}
.mobile-trigger span:nth-child(1), .mobile-trigger span:nth-child(2) {
top: 0;
}
.mobile-trigger span:nth-child(3), .mobile-trigger span:nth-child(4) {
top: 11px;
}
.mobile-trigger span:nth-child(5), .mobile-trigger span:nth-child(6) {
top: 22px;
}
.mobile-open .mobile-trigger span:nth-child(1), .mobile-open .mobile-trigger span:nth-child(6) {
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.mobile-open .mobile-trigger span:nth-child(2), .mobile-open .mobile-trigger span:nth-child(5) {
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
.mobile-open .mobile-trigger span:nth-child(1) {
left: 0;
top: 6px;
}
.mobile-open .mobile-trigger span:nth-child(2) {
left: calc(50% - 5px);
top: 6px;
}
.mobile-open .mobile-trigger span:nth-child(3) {
left: -50%;
opacity: 0;
}
.mobile-open .mobile-trigger span:nth-child(4) {
left: 100%;
opacity: 0;
}
.mobile-open .mobile-trigger span:nth-child(5) {
left: 0;
top: 18px;
}
.mobile-open .mobile-trigger span:nth-child(6) {
left: calc(50% - 5px);
top: 18px;
}
Comments
Post a Comment