Skip to content

Instantly share code, notes, and snippets.

@jgthms
Created November 27, 2016 16:48
Show Gist options
  • Select an option

  • Save jgthms/05304ee627d0e73452af5552778ad697 to your computer and use it in GitHub Desktop.

Select an option

Save jgthms/05304ee627d0e73452af5552778ad697 to your computer and use it in GitHub Desktop.
const shiftCurve = mojs.easing.path( 'M0,100 C50,100 50,100 50,50 C50,0 50,0 100,0' );
const scaleCurveBase = mojs.easing.path( 'M0,100 C21.3776817,95.8051376 50,77.3262711 50,-700 C50,80.1708527 76.6222458,93.9449005 100,100' );
const scaleCurve = (p) => { return 1 + scaleCurveBase(p); };
const nScaleCurve = (p) => { return 1 - scaleCurveBase(p)/10; };
const circle = new mojs.Shape({
shape: 'rect',
fill: { '#F64040' : '#F64040', curve: scaleCurve },
radius: 10,
rx: 3,
x: { [-125] : 125, easing: shiftCurve },
scaleX: { 1 : 1, curve: scaleCurve },
scaleY: { 1 : 1, curve: nScaleCurve },
origin: { '0 50%' : '100% 50%', easing: shiftCurve },
isYoyo: true,
delay: 500,
duration: 800,
repeat: 999,
//isForce3d: true
}).play();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment