@smoovy/tween
Version:
simple and easy-to-use tween lib
20 lines (19 loc) • 606 B
JavaScript
;
import { TweenController } from "../controller";
import { Tween } from "../tween";
function to(from2, to2, config = {}) {
return new Tween({ from: from2, to: to2, ...config });
}
function fromTo(target, from2, to2, config = {}) {
return new Tween({ target, from: from2, to: to2, ...config });
}
function from() {
throw new Error("Not implemented yet");
}
function noop() {
return new TweenController({ duration: 1e-3 }).start();
}
function delay(duration = 100, config = {}) {
return new TweenController({ duration, ...config }).start();
}
export { fromTo, to, from, noop, delay };