Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
easePolyFactory = d3Ease.easePolyOut;
easePolyFactory = d3Ease.easePolyOut.exponent(2);
t_out = easePolyFactory(t_in);
scrollTimer = timer(elapsed => {
const t = easeCubicOut(Math.min(elapsed / duration, 1))
window.scroll(0, Math.round(n(t)))
if (t >= 1) {
scrollTimer.stop()
}
})
}
const t = timer((elapsed) => {
const te = easeCubicOut(timeScale(elapsed));
const pathOffset = offsetScale(te);
this.setState({ pathOffset });
if (elapsed > duration) {
window.setTimeout(() => this.restartTransition(), 2000);
return t.stop();
}
});
}
scrollTimer = timer(elapsed => {
const t = easeCubicOut(Math.min(elapsed / duration, 1))
window.scroll(0, Math.round(n(t)))
if (t >= 1) {
scrollTimer.stop()
}
})
}