goncy / react-swipy

A simple Tinder-like swipeable React component
MIT License
27 stars 19 forks source link

Opacity start value #1

Closed SergeyChehuta closed 6 years ago

SergeyChehuta commented 6 years ago

Could you add a property to change opacity only after some offset? for example:

var getOpacity = function getOpacity(offset, limit) {
  const minOffset = limit/2 // some.prop.here
  if (Math.abs(offset) < minOffset) return 1
  return 1 - (Math.abs(offset) - minOffset) / limit;
};
goncy commented 6 years ago

Implemented in version 0.0.6 the prop is called min