Animated Burgers
How do I make an animated burgers?
Following on from pens by CreativeJuiz and Loredonut. What is a animated burgers? How do you make a animated burgers? This script and codes were developed by Adam Orchard on 02 December 2022, Friday.
Animated Burgers - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated Burgers</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { background: #555555;
}
header { background: #424242; padding: 10px;
}
.burger { margin: 10px; display: inline-block; width: 72px; height: 60px;
}
.burger span,
.burger span:before,
.burger span:after { display: block; width: 100%; height: 12px; background: #51b4c5; transition: all 0.5s; backface-visibility: hidden;
}
.burger span { position: relative; margin: 24px 0 0;
}
.burger span:before,
.burger span:after { position: absolute; content: "";
}
.burger span:before { top: -24px;
}
.burger span:after { top: 24px;
}
.burger1.selected span:before { transform: translate(0px, 24px) rotate(-45deg);
}
.burger1.selected span:after { transform: translate(0px, -24px) rotate(45deg);
}
.burger1.selected span { background: transparent;
}
.burger2.selected span:before { transform: translate(0px, 24px) rotate(-90deg);
}
.burger2.selected span:after { transform: translate(0px, -24px) rotate(-90deg);
}
.burger2.selected span { transform: rotate(45deg);
}
.burger3.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger3.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger3.selected span { transform: rotate(-45deg);
}
.burger4:hover span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger4:hover span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger4.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger4.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger4.selected span { transform: rotate(-45deg);
}
.burger5:hover span { transform: scale(0.5);
}
.burger5:hover span:before { transform: translate(12px, 0px) rotate(45deg);
}
.burger5:hover span:after { transform: translate(12px, 0px) rotate(-45deg);
}
.burger5.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger5.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger5.selected span { transform: rotate(-45deg);
}
.burger5.selected:hover span { transform: scale(0.5);
}
.burger5.selected:hover span:before { transform: translate(-12px, 0px) rotate(-45deg);
}
.burger5.selected:hover span:after { transform: translate(-12px, 0px) rotate(45deg);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <header> <a class="burger burger1" href="#"><span></span></a> <a class="burger burger2" href="#"><span></span></a> <a class="burger burger3" href="#"><span></span></a> <a class="burger burger4" href="#"><span></span></a> <a class="burger burger5" href="#"><span></span></a>
</header>
<!--
Following on from https://codepen.io/CreativeJuiz/pen/oCBxz and https://codepen.io/loredonut/pen/hjuai
--> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Animated Burgers - Script Codes CSS Codes
body { background: #555555;
}
header { background: #424242; padding: 10px;
}
.burger { margin: 10px; display: inline-block; width: 72px; height: 60px;
}
.burger span,
.burger span:before,
.burger span:after { display: block; width: 100%; height: 12px; background: #51b4c5; transition: all 0.5s; backface-visibility: hidden;
}
.burger span { position: relative; margin: 24px 0 0;
}
.burger span:before,
.burger span:after { position: absolute; content: "";
}
.burger span:before { top: -24px;
}
.burger span:after { top: 24px;
}
.burger1.selected span:before { transform: translate(0px, 24px) rotate(-45deg);
}
.burger1.selected span:after { transform: translate(0px, -24px) rotate(45deg);
}
.burger1.selected span { background: transparent;
}
.burger2.selected span:before { transform: translate(0px, 24px) rotate(-90deg);
}
.burger2.selected span:after { transform: translate(0px, -24px) rotate(-90deg);
}
.burger2.selected span { transform: rotate(45deg);
}
.burger3.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger3.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger3.selected span { transform: rotate(-45deg);
}
.burger4:hover span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger4:hover span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger4.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger4.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger4.selected span { transform: rotate(-45deg);
}
.burger5:hover span { transform: scale(0.5);
}
.burger5:hover span:before { transform: translate(12px, 0px) rotate(45deg);
}
.burger5:hover span:after { transform: translate(12px, 0px) rotate(-45deg);
}
.burger5.selected span:before { transform: translate(0px, 24px) rotate(90deg);
}
.burger5.selected span:after { transform: translate(0px, -24px) rotate(90deg);
}
.burger5.selected span { transform: rotate(-45deg);
}
.burger5.selected:hover span { transform: scale(0.5);
}
.burger5.selected:hover span:before { transform: translate(-12px, 0px) rotate(-45deg);
}
.burger5.selected:hover span:after { transform: translate(-12px, 0px) rotate(45deg);
}
Animated Burgers - Script Codes JS Codes
$("a.burger").click(function(){ $(this).toggleClass("selected");
});
Developer | Adam Orchard |
Username | orchard |
Uploaded | December 02, 2022 |
Rating | 4 |
Size | 3,329 Kb |
Views | 8,096 |
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!
Name | Size |
Colour Themes | 2,662 Kb |
A Pen by Adam Orchard | 1,983 Kb |
CSS Gem Badge | 3,335 Kb |
CSS Triangle Animation | 2,638 Kb |
CSS Moon - dribbble rebound | 2,929 Kb |
Burger with Label | 3,346 Kb |
Tree growth tests | 3,818 Kb |
WIP | 2,835 Kb |
Parallax Clouds | 7,285 Kb |
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!
Name | Username | Size |
Isometric css island | Xaddict | 2,950 Kb |
Two Element Typeface | Chrisota | 4,942 Kb |
Awesome | Samarthpd | 2,901 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
Gears | Synvox | 3,278 Kb |
Experiments with Vertical Centering | KatieK2 | 3,924 Kb |
Click Based Rotation Demo | Zeaklous | 2,086 Kb |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
CSS only simple parallax scroll | Stanssongs | 3,708 Kb |
Save for later... | Victorfreire | 1,359 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!