|
|
|
@ -173,8 +173,12 @@ export function transition(flags, element, get_fn, get_params) {
|
|
|
|
|
|
|
|
|
|
|
|
current_animation.finished
|
|
|
|
current_animation.finished
|
|
|
|
.then(() => {
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
if (target === 1) {
|
|
|
|
|
|
|
|
current_options = null;
|
|
|
|
|
|
|
|
current_animation = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
p = target;
|
|
|
|
p = target;
|
|
|
|
current_animation = current_options = null;
|
|
|
|
|
|
|
|
callbacks.forEach(run);
|
|
|
|
callbacks.forEach(run);
|
|
|
|
dispatch_event(element, target === 1 ? 'introend' : 'outroend');
|
|
|
|
dispatch_event(element, target === 1 ? 'introend' : 'outroend');
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -191,9 +195,13 @@ export function transition(flags, element, get_fn, get_params) {
|
|
|
|
|
|
|
|
|
|
|
|
current_task = loop((now) => {
|
|
|
|
current_task = loop((now) => {
|
|
|
|
if (now >= end_time) {
|
|
|
|
if (now >= end_time) {
|
|
|
|
|
|
|
|
if (target === 1) {
|
|
|
|
|
|
|
|
current_task = null;
|
|
|
|
|
|
|
|
current_options = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
p = target;
|
|
|
|
p = target;
|
|
|
|
tick?.(target, 1 - target);
|
|
|
|
tick?.(target, 1 - target);
|
|
|
|
current_task = current_options = null;
|
|
|
|
|
|
|
|
callbacks.forEach(run);
|
|
|
|
callbacks.forEach(run);
|
|
|
|
dispatch_event(element, target === 1 ? 'introend' : 'outroend');
|
|
|
|
dispatch_event(element, target === 1 ? 'introend' : 'outroend');
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
@ -219,8 +227,6 @@ export function transition(flags, element, get_fn, get_params) {
|
|
|
|
const time = /** @type {number} */ (current_animation.currentTime);
|
|
|
|
const time = /** @type {number} */ (current_animation.currentTime);
|
|
|
|
const duration = /** @type {number} */ (current_options.duration);
|
|
|
|
const duration = /** @type {number} */ (current_options.duration);
|
|
|
|
p = (Math.abs(current_delta) * time) / duration;
|
|
|
|
p = (Math.abs(current_delta) * time) / duration;
|
|
|
|
current_animation.cancel();
|
|
|
|
|
|
|
|
current_animation = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -237,6 +243,11 @@ export function transition(flags, element, get_fn, get_params) {
|
|
|
|
callbacks = [];
|
|
|
|
callbacks = [];
|
|
|
|
element.inert = inert;
|
|
|
|
element.inert = inert;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (current_animation) {
|
|
|
|
|
|
|
|
current_animation.cancel();
|
|
|
|
|
|
|
|
current_animation = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (intro) {
|
|
|
|
if (intro) {
|
|
|
|
if (current_direction !== TRANSITION_IN) {
|
|
|
|
if (current_direction !== TRANSITION_IN) {
|
|
|
|
current_direction = TRANSITION_IN;
|
|
|
|
current_direction = TRANSITION_IN;
|
|
|
|
|