Created
July 4, 2017 18:29
-
-
Save ahmedam55/33a8bbe1c754ebab8a895326879d2077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg = document.getElementById("cups"); | |
var s = Snap(svg); | |
var simpleCup = Snap.select('#simple-cup'); | |
var fancyCup = Snap.select('#fancy-cup'); | |
var simpleCupPoints = simpleCup.node.getAttribute('d'); | |
var fancyCupPoints = fancyCup.node.getAttribute('d'); | |
var toFancy = function(){ | |
simpleCup.animate({ d: fancyCupPoints }, 1000, mina.backout, toSimple); | |
} | |
var toSimple = function(){ | |
simpleCup.animate({ d: simpleCupPoints }, 1000, mina.backout, toFancy); | |
} | |
toSimple(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment