baptistebriel / smooth-scrolling

smooth scrolling and parallax effects on scroll
MIT License
612 stars 75 forks source link

Custom easing function? #98

Closed rijk closed 5 years ago

rijk commented 6 years ago

Hey Baptiste, great package. I am trying to achieve the same effect as on https://louisansa.com/about. Are you using a different easing method there? Can you do this using this package?

baptistebriel commented 5 years ago

Hey @rijk – Indeed, on Louis Ansa's portfolio I just multiply the current value by a factor of .75. Something like this should do the trick:

const value = -(this.vars.current * .75).toFixed(2)
el.style[this.prefix] = this.getTransform(value)

Hope it helps!