MENU to Close Arrow

Developer
Size
2,593 Kb
Views
32,384

How do I make an menu to close arrow?

Could be used as an alternative to the hamburger to x fad going around for slide out side menus. The M is made up of horizontal rules. I like this concept, but it's not too lightweight unfortunately.. What is a menu to close arrow? How do you make a menu to close arrow? This script and codes were developed by Jack on 16 September 2022, Friday.

MENU to Close Arrow Previews

MENU to Close Arrow - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>MENU to Close Arrow</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <input type="checkbox" id="toggle-menu">
<label for="toggle-menu" id="btn-menu"> <div class="M"> <hr> <hr> <hr> <hr> </div> <span>OME</span>	<hr>
</label> <script src="js/index.js"></script>
</body>
</html>

MENU to Close Arrow - Script Codes CSS Codes

@import url(https://fonts.googleapis.com/css?family=Raleway:300);
body{ background-color:#EF4836; padding-top:80px;
}
#btn-menu{ font-size:70px; font-family: 'Raleway', sans-serif; cursor:pointer; width:240px; height:100px; display:block; margin:0 auto;
}
#btn-menu span{ -webkit-transition:all .5s ease; transition: all .5s ease; color:#C0392B;
}
#btn-menu:hover span{ color:#96281B;
}
#btn-menu:hover hr{ background-color:#96281B !important;
}
.M{ position:relative; width:30px; height:70px; top:-15px; left:8px; margin:0 auto; trasition:trasnlateZ(0); -webkit-transition:all .5s ease; transition: all .5s ease; display:inline-block;
}
#btn-menu > hr{ height:3px; border:none; background-color:#C0392B; border-radius:2px; position:relative; bottom:20px; width:240px; -webkit-transition:all .5s ease; transition: all .5s ease;
}
.M hr{ height:4px; border:none; background-color:#C0392B; border-radius:2px; width:50px; position:absolute; top:24px; -webkit-transition:all .5s ease; transition: all .5s ease;
}
.M hr:nth-child(2){ width:18px; top:25px; left:-0px; -webkit-transform:rotate(0deg); transform:rotate(0deg);
}
.M hr:nth-child(3){ width:18px; top:25px; right:0px; -webkit-transform:rotate(0deg); transform:rotate(0deg);
}
.M hr:first-child, .M hr:last-child{ -webkit-transform:rotate(90deg); transform:rotate(90deg);
}
.M hr:first-child{ left:-25px;
}
.M hr:last-child{ left:6px;
}
#toggle-menu{ display:none;
}
#toggle-menu:checked + #btn-menu > hr{ width:0px;
}
#toggle-menu:checked + #btn-menu .M{ -webkit-animation:rotateOpen .5s forwards; animation:rotateOpen .5s forwards; top:25px; left:30%;
}
#toggle-menu:checked + #btn-menu span{ opacity:0; margin-left:10px;
}
#toggle-menu:checked + #btn-menu .M hr:nth-child(2){	-webkit-animation:toArrow1 .5s forwards; animation:toArrow1 .5s forwards;
}
#toggle-menu:checked + #btn-menu .M hr:nth-child(3){	-webkit-animation:toArrow2 .4s forwards; animation:toArrow2 .4s forwards;
}
#toggle-menu:checked + #btn-menu .M hr:first-child{	-webkit-animation:toArrow3 .5s forwards; animation:toArrow3 .5s forwards;
}
#toggle-menu:checked + #btn-menu .M hr:last-child{	-webkit-animation:toArrow4 .5s forwards; animation:toArrow4 .5s forwards;
}
@-webkit-keyframes rotateOpen{ 0%{ -webkit-transform:rotate(0deg); transform:rotate(0deg); } 100%{ -webkit-transform:rotate(-90deg); transform:rotate(-90deg); }
}
@keyframes rotateOpen{ 0%{ -webkit-transform:rotate(0deg); transform:rotate(0deg); } 100%{ -webkit-transform:rotate(-90deg); transform:rotate(-90deg); }
}
@-webkit-keyframes toArrow1{ 0%{ -webkit-transform:rotate(60deg); transform:rotate(60deg); } 100%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); top:24px; width:50px; left:0px; }
}
@keyframes toArrow1{ 0%{ -webkit-transform:rotate(60deg); transform:rotate(60deg); } 100%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); top:24px; width:50px; left:0px; }
}
@-webkit-keyframes toArrow2{ 0%{ -webkit-transform:rotate(-60deg); transform:rotate(-60deg); } 95%{ opacity:1; } 100%{ -webkit-transform:rotate(-90deg); transform:rotate(-90deg); top:24px; width:50px; right:0px; opacity:0; }
}
@keyframes toArrow2{ 0%{ -webkit-transform:rotate(-60deg); transform:rotate(-60deg); } 95%{ opacity:1; } 100%{ -webkit-transform:rotate(-90deg); transform:rotate(-90deg); top:24px; width:50px; right:0px; opacity:0; }
}
@-webkit-keyframes toArrow3{ 0%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); left:-25px; } 100%{ -webkit-transform:rotate(120deg); transform:rotate(120deg); left:2px; width:32px; top:9px; }
}
@keyframes toArrow3{ 0%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); left:-25px; } 100%{ -webkit-transform:rotate(120deg); transform:rotate(120deg); left:2px; width:32px; top:9px; }
}
@-webkit-keyframes toArrow4{ 0%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); left:25px; } 100%{ -webkit-transform:rotate(60deg); transform:rotate(60deg); left:17px; width:32px; top:9px; }
}
@keyframes toArrow4{ 0%{ -webkit-transform:rotate(90deg); transform:rotate(90deg); left:25px; } 100%{ -webkit-transform:rotate(60deg); transform:rotate(60deg); left:17px; width:32px; top:9px; }
}

MENU to Close Arrow - Script Codes JS Codes

/*something different than all the hamburger to x animations*/
MENU to Close Arrow - Script Codes
MENU to Close Arrow - Script Codes
Home Page Home
Developer Jack
Username jackmoran
Uploaded September 16, 2022
Rating 3
Size 2,593 Kb
Views 32,384
Do you need developer help for MENU to Close Arrow?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Jack (jackmoran) Script Codes
Create amazing art & images with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!