Animated Burgers

Developer
Size
3,329 Kb
Views
8,096

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 Previews

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");
});
Animated Burgers - Script Codes
Animated Burgers - Script Codes
Home Page Home
Developer Adam Orchard
Username orchard
Uploaded December 02, 2022
Rating 4
Size 3,329 Kb
Views 8,096
Do you need developer help for Animated Burgers?

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!

Adam Orchard (orchard) 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!