motion-dom
Version:
24 lines (21 loc) • 818 B
JavaScript
import { NativeAnimation } from './NativeAnimation.mjs';
import { notifyAnimationStart } from './utils/notify-inspector.mjs';
class NativeAnimationWrapper extends NativeAnimation {
constructor(animation) {
super();
this.animation = animation;
animation.onfinish = this.onFinish = () => {
animation.onfinish = null;
this.finishedTime = this.time;
this.notifyFinished();
};
/**
* The optionless super() returns before NativeAnimation's own
* notify, so wrapped animations (view transition cross-fades)
* report here, after the wrapped WAAPI animation is attached.
*/
notifyAnimationStart(this, {});
}
}
export { NativeAnimationWrapper };
//# sourceMappingURL=NativeAnimationWrapper.mjs.map