Last active
April 9, 2018 12:43
-
-
Save eeropic/6ce7c427bc3fbe5eb5426e58a9aedd64 to your computer and use it in GitHub Desktop.
anime.js + paper.js
This file contains hidden or 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
include('http://eerojohannes.com/js/anime.min.js') | |
var item=new Path.Circle([100,100],50) | |
item.fillColor="red" | |
/* | |
old way | |
let segs=[] | |
for(let i in item.segments){ | |
segs.push(item.segments[i].point) | |
} | |
*/ | |
let segs = item.segments.map(seg => seg.point); | |
var test=anime({ | |
duration:500, | |
easing:'easeInOutCubic', | |
targets: segs, | |
x:function(el, i, l) { | |
return el.x+(i+1)*100 | |
}, | |
y:function(el, i, l) { | |
return el.y+(i+1)*100 | |
}, | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment