Skip to content

Instantly share code, notes, and snippets.

@ahmedam55
Created July 4, 2017 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahmedam55/33a8bbe1c754ebab8a895326879d2077 to your computer and use it in GitHub Desktop.
Save ahmedam55/33a8bbe1c754ebab8a895326879d2077 to your computer and use it in GitHub Desktop.
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