Skip to content

Instantly share code, notes, and snippets.

@colinmeinke
Created April 18, 2016 00:50
Show Gist options
  • Save colinmeinke/4edf3f0fbb4ff5505a6447345d13b3cc to your computer and use it in GitHub Desktop.
Save colinmeinke/4edf3f0fbb4ff5505a6447345d13b3cc to your computer and use it in GitHub Desktop.
const a = animate( '.svg', [
{
from: {
offset: [ 10, 20 ],
fill: 'rgb( 100, 100, 100 )',
},
to: {
shape: 'circle',
cx: 50,
cy: 50,
r: 20,
fill: 'rgb( 20, 20, 20 )',
},
ease: 'easeInQuad',
duration: 500,
motionPath: [
{ x: 0, y: 0 },
{ x: 100, y: 100, curve: { type: 'cubic', x1: 20, y1: 0, x2: 0, y2: 100 },
],
when: 1000,
},
{
from: {
shape: 'g',
shapes: [
'.path1',
'.path2',
'.path3',
],
},
to: {
shape: 'g',
shapes: [
{
shape: 'path',
d: '...',
},
{
shape: 'path',
d: '...',
},
{
shape: 'path',
d: '...',
},
],
},
when: -200,
},
]);
a.play({ reverse: true, speed: 0.5 }).then(() => {
console.log( 'animation finished' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment