|
|
@ -18,7 +18,6 @@ function wait() {
|
|
|
|
let outros;
|
|
|
|
let outros;
|
|
|
|
|
|
|
|
|
|
|
|
export function group_outros() {
|
|
|
|
export function group_outros() {
|
|
|
|
console.log('grouping');
|
|
|
|
|
|
|
|
outros = {
|
|
|
|
outros = {
|
|
|
|
remaining: 0,
|
|
|
|
remaining: 0,
|
|
|
|
callbacks: []
|
|
|
|
callbacks: []
|
|
|
@ -26,15 +25,12 @@ export function group_outros() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function check_outros() {
|
|
|
|
export function check_outros() {
|
|
|
|
console.trace(`${outros.remaining} outros remaining`);
|
|
|
|
|
|
|
|
if (!outros.remaining) {
|
|
|
|
if (!outros.remaining) {
|
|
|
|
console.log(outros.callbacks.map(c => c.toString()))
|
|
|
|
|
|
|
|
run_all(outros.callbacks);
|
|
|
|
run_all(outros.callbacks);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function on_outro(callback) {
|
|
|
|
export function on_outro(callback) {
|
|
|
|
console.log('adding', callback.toString());
|
|
|
|
|
|
|
|
outros.callbacks.push(callback);
|
|
|
|
outros.callbacks.push(callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -251,7 +247,6 @@ export function create_bidirectional_transition(node, fn, params, intro) {
|
|
|
|
node.dispatchEvent(new window.CustomEvent(`${running_program.b ? 'intro' : 'outro'}start`));
|
|
|
|
node.dispatchEvent(new window.CustomEvent(`${running_program.b ? 'intro' : 'outro'}start`));
|
|
|
|
|
|
|
|
|
|
|
|
loop(now => {
|
|
|
|
loop(now => {
|
|
|
|
console.log({ now, pending_program, running_program });
|
|
|
|
|
|
|
|
if (pending_program && now > pending_program.start) {
|
|
|
|
if (pending_program && now > pending_program.start) {
|
|
|
|
running_program = init(pending_program, duration);
|
|
|
|
running_program = init(pending_program, duration);
|
|
|
|
pending_program = null;
|
|
|
|
pending_program = null;
|
|
|
@ -282,7 +277,6 @@ export function create_bidirectional_transition(node, fn, params, intro) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log('running program ended');
|
|
|
|
|
|
|
|
running_program = null;
|
|
|
|
running_program = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -300,7 +294,6 @@ export function create_bidirectional_transition(node, fn, params, intro) {
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
run(b) {
|
|
|
|
run(b) {
|
|
|
|
console.log(`run`, b);
|
|
|
|
|
|
|
|
if (typeof config === 'function') {
|
|
|
|
if (typeof config === 'function') {
|
|
|
|
wait().then(() => {
|
|
|
|
wait().then(() => {
|
|
|
|
config = config();
|
|
|
|
config = config();
|
|
|
@ -312,7 +305,6 @@ export function create_bidirectional_transition(node, fn, params, intro) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
end() {
|
|
|
|
end() {
|
|
|
|
console.log('end');
|
|
|
|
|
|
|
|
clear_animation();
|
|
|
|
clear_animation();
|
|
|
|
running_program = pending_program = null;
|
|
|
|
running_program = pending_program = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|