Skip to content

Instantly share code, notes, and snippets.

@tarun-dugar
Created May 6, 2019 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarun-dugar/cd5ea1138a49de63cfe0563cf77cc1d6 to your computer and use it in GitHub Desktop.
Save tarun-dugar/cd5ea1138a49de63cfe0563cf77cc1d6 to your computer and use it in GitHub Desktop.
smoothScroll({
scrollElement: window,
scrollAmount: 300,
cubicBezierPoints: {
x1: 0.2,
x2: 0.5,
y1: 0.5,
y2: 0.9
},
onRefUpdateCallback: (animationInstance) => {
// cancelAnimationFrame(animationInstance);
},
onAnimationCompleteCallback: () => {
console.log('animation complete!');
},
duration: 2000,
direction: 'right'
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment