Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* Note: These tests are intended to test the definitions only
* in the sense of typing and call signature consistency. They
* are not intended as functional tests.
*/
import * as d3Ease from 'd3-ease';
let t_in: number = 0.5;
let t_out: number;
t_out = d3Ease.easeLinear(t_in);
t_out = d3Ease.easeQuad(t_in);
t_out = d3Ease.easeQuadIn(t_in);
t_out = d3Ease.easeQuadOut(t_in);
t_out = d3Ease.easeQuadInOut(t_in);
t_out = d3Ease.easeCubic(t_in);
t_out = d3Ease.easeCubicIn(t_in);
t_out = d3Ease.easeCubicOut(t_in);
t_out = d3Ease.easeCubicInOut(t_in);
let easePolyFactory: d3Ease.PolynomialEasingFactory;
easePolyFactory = d3Ease.easePoly;
easePolyFactory = d3Ease.easePoly.exponent(2);
t_out = easePolyFactory(t_in);
easePolyFactory = d3Ease.easePolyIn;
easePolyFactory = d3Ease.easePolyIn.exponent(2);
t_out = easePolyFactory(t_in);
const updateScroll = e => {
const pos = scrollSpring.getValue();
if (pos >= 0 && pos <= 20) {
let e = easeQuadInOut(pos / 20);
position = [0, e * -5, e * 15 + 5];
rotation = [e * -10, 0, 0];
} else if (pos > 20 && pos <= 40) {
let e = easeQuadInOut((pos - 20) / 20);
position = [0, -5 + e * 5, 15 + 5 - e * 15];
rotation = [-10 + e * -80, 0, 0];
} else if (pos > 40 && pos <= 90) {
let e = (pos - 40) / 50;
position = [0, e * 40, 5];
rotation = [-90, 0, 0];
} else if (pos > 90 && pos <= 100) {
let e = easeQuadOut((pos - 90) / 10);
position = [0, 40 + e * 5, 5];
rotation = [-90, 0, 0];