Skip to content

Instantly share code, notes, and snippets.

@eeropic
Last active April 9, 2018 12:43
Show Gist options
  • Save eeropic/6ce7c427bc3fbe5eb5426e58a9aedd64 to your computer and use it in GitHub Desktop.
Save eeropic/6ce7c427bc3fbe5eb5426e58a9aedd64 to your computer and use it in GitHub Desktop.
anime.js + paper.js
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