Snap: Chomping hamburger
How do I make an snap: chomping hamburger?
Simple snap animation on click. What is a snap: chomping hamburger? How do you make a snap: chomping hamburger? This script and codes were developed by Amanda Cheung on 15 November 2022, Tuesday.
Snap: Chomping hamburger - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Snap: Chomping hamburger</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="animation" class="animation"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.3.0/snap.svg-min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Snap: Chomping hamburger - Script Codes CSS Codes
.animation { margin-right: auto; margin-left: auto; width: 342px; -webkit-transform: scale(.75,.75); transform: scale(.75,.75);
}
Snap: Chomping hamburger - Script Codes JS Codes
window.onload = function() { var animation = Snap.selectAll('.animation'); Snap.load("https://dl.dropboxusercontent.com/u/38675407/the-whole-burger.svg", function (s) { var whole = s.select('#whole'), top = whole.select('#top-bun'), lettuce = whole.select('#lettuce'), tomato = whole.select('#tomato'), cheese = whole.select('#cheese'), burger = whole.select('#burger'), bottom = whole.select('#bottom-bun'), animating = false; function reset() { whole.transform("t0,0"); } function expand(delay, length) { animating = true; top.animate({ transform: "t0,-100" }, length, mina.easeinout); lettuce.animate({ transform: "t0,-60" }, length, mina.easeinout); tomato.animate({ transform: "t0,-20" }, length, mina.easeinout); cheese.animate({ transform: "t0,20" }, length, mina.easeinout); burger.animate({ transform: "t0,60" }, length, mina.easeinout); bottom.animate({ transform: "t0,100" }, length, mina.easeinout); } function chomp(delay, length) { setTimeout(function(){ top.animate({ transform: "t0,0" }, length, mina.easeout); lettuce.animate({ transform: "t0,0" }, length, mina.easeout); tomato.animate({ transform: "t0,0" }, length, mina.easeout); cheese.animate({ transform: "t0,0" }, length, mina.easeout); burger.animate({ transform: "t0,0" }, length, mina.easeout); bottom.animate({ transform: "t0,0" }, length, mina.easeout); }, delay); } function burger_chomp() { expand(0, 900); chomp(1000, 80); } reset() animation.forEach(function(el) { el.append(s); }); whole.click(function() { reset(); burger_chomp(); }); });
}
Developer | Amanda Cheung |
Username | acacheung |
Uploaded | November 15, 2022 |
Rating | 3 |
Size | 2,137 Kb |
Views | 16,192 |
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 |
Link transition and keyframe animation demo | 1,681 Kb |
Dobot wireframe | 1,507 Kb |
A Pen by Amanda Cheung | 1,572 Kb |
Open close icon animation | 1,822 Kb |
Multi-step GSAP animation | 2,668 Kb |
GSAP rising block with reflection | 2,516 Kb |
Click nav to back arrow | 2,066 Kb |
Why Make Sense - Hot Chip | 1,659 Kb |
GSAP rising block | 2,417 Kb |
Hello responsive logo | 1,588 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 |
Dice | Fraina | 5,026 Kb |
Incremental game | Eprouver | 5,868 Kb |
Flying Bee | Pwsm50 | 3,711 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Animated Vertical CSS3 Menu Black | MaCeLMp4 | 2,750 Kb |
Simple Login Form Template | Banunn | 3,571 Kb |
AOR site logo | Thatbram | 2,527 Kb |
Login-ng-modal | Heedoo | 3,566 Kb |
Wikipedia API | Coderpilot | 2,802 Kb |
Login with flip 3d animation | Mariusbalaj | 3,014 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!