Create An Animated Menu Toggle Button | Html CSS & Javascript, step-by-step from scratch.
Supply Code:
A Easy Markup:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Animated Menu Toggle Button</title>
<hyperlink rel="stylesheet" href="type.css">
</head>
<physique>
<div class="toggle">
<span></span>
<span></span>
<span></span>
</div>
<script src="app.js"></script>
</physique>
</html>
Then a Couple of Strains of CSS:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
physique{
show: flex;
justify-content: middle;
align-items: middle;
min-height: 100vh;
background: #e9ecef;
}
.toggle{
place: relative;
width: 70px;
peak: 70px;
background: #fff;
box-shadow: 0 10px 20px rgba(0,0,0,0.08);
border-radius: 10px;
show: flex;
justify-content: middle;
align-items: middle;
cursor: pointer;
overflow: hidden;
}
.toggle span{
place: absolute;
width: 40px;
peak: 4px;
background: #4263eb;
border-radius: 4px;
transition: 0.5s;
}
.toggle span:nth-child(1){
rework: translateY(-15px);
width: 25px;
left: 15px;
}
.toggle.lively span:nth-child(1){
width: 40px;
rework: translateY(0px) rotate(45deg);
transition-delay: 0.125s;
}
.toggle span:nth-child(2){
rework: translateY(15px);
width: 15px;
left: 15px;
}
.toggle.lively span:nth-child(2){
width: 40px;
rework: translateY(0px) rotate(315deg);
transition-delay: 0.25s;
}
.toggle.lively span:nth-child(3){
rework: translateX(60px);
}
Observe us on YT
https://bit.ly/3oBQbc0