Skip to content

Instantly share code, notes, and snippets.

@KristofferBerg
Created January 3, 2020 13:15
Show Gist options
  • Select an option

  • Save KristofferBerg/501ef05c7c5dfb1f1e90c754d6d6bb1e to your computer and use it in GitHub Desktop.

Select an option

Save KristofferBerg/501ef05c7c5dfb1f1e90c754d6d6bb1e to your computer and use it in GitHub Desktop.
Mock of Animation object
const object = {
anim: {
effects: [
pulse: {
start: {
scaleX: object.scaleX * 1.25,
scaleY: object.scaleY * 1.25,
},
end: {
scaleX: object.scaleX,
scaleY: object.scaleY,
},
delay: 0, // wait this long before animating
duration: 2500, // a single effect run last this long
hangtime: 1000, // let end (or start) state hang this long between iteration (if any)
iterations: 5, // how many times will the animation run.
direction: 'alternate', // "normal, reverse, alternate". Alternate = Play the animation forwards first, then backwards:
easing: 'easeInOutExpo',
},
fadeIn: {
start: {
opacity: 0,
},
end: {
opacity: object.opacity,
},
delay: 1000,
duration: 1500,
iterations: 1,
direction: 'normal',
easing: 'linear',
},
slideFromLeft: {
start: {
left: 0,
},
end: {
left: object.left,
},
delay: 1000,
duration: 2000,
iterations: 1,
direction: 'normal',
easing: 'easeInOutExpo',
},
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment