Alexey, EPAM
First law of motion
iOS 5
-webkit-overflow-scrolling: touch
we can leave artificial scrollers behind
doMomentum() {
const transition =
`transform ${time
}ms cubic-bezier(0.33, 0.66, 0.66, 1)`;
this.setTransition(this.element, transition);
this.setTransform(this.element,
`translate3d(0, ${newY}px, 0)`);
}
doMomentum() {
const transition =
`transform ${time
}ms cubic-bezier(0.33, 0.66, 0.66, 1)`;
this.setTransition(this.element, transition);
this.setTransform(this.element,
`translate3d(0, ${newY}px, 0)`);
}
doMomentum() {
const transition =
`transform ${time
}ms cubic-bezier(0.33, 0.66, 0.66, 1)`;
this.setTransition(this.element, transition);
this.setTransform(this.element,
`translate3d(0, ${newY}px, 0)`);
}
cubic-bezier(.33, .66, .66, 1)
snapToBounds() {
const transition = 'transform' +
'500ms ease-out';
this.setTransition(this.element,
transition);
this.setTransform(this.element,
`translate3d(0, ${startY}px, 0)`);
}
cubic-bezier(0, 0, .58, 1), ease-out
const valueToLowerCubicBezierWith =
Math.abs(this.endMomentumVelocity_ /
velocity) * .33;
const transition =
`transform ${time}ms cubic-bezier(.33,${
(.66 - valueToLowerCubicBezierWith)
},.66,${
(1 - valueToLowerCubicBezierWith)})`
this.setTransition(this.element, transition);
this.setTransform(this.element,
`translate3d(0, ${this.contentOffsetY
}px, 0)`);
npm install momentum-scroller
Send pull requests to https://github.com/alexeykomov/momentum-scroller