Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
sentSprites.forEach(sprite => {
// this is needed because we're dealing with orphans who will no longer
// automatically ride along with their original parent.
//
// TODO: if a parent and child sprite both get orphaned, can we maintain
// their relationship? That would be best.
move(sprite);
opacity(sprite, { to: 0, duration: duration * 0.2 });
sprite.applyStyles({ 'z-index': 1 });
});
receivedSprites.forEach(sprite => {
sentSprites.forEach(sprite => {
// Caution! This is a hack. It just happens to be safe in this situation
// because we're messing with only the children of sentSprites, which will
// all get destroyed at the end of animation regardless.
[...sprite.element.children].forEach(element => {
element.classList.add('ember-animated-hidden');
});
sprite.applyStyles({ 'z-index': 1 });
move(sprite);
resize(sprite);
adjustColor.property('background-color')(sprite);
});
}
insertedSprites.forEach(sprite => {
sprite.startAtPixel({ x: window.innerWidth });
move(sprite, { easing: easeOut });
});
* shuffle({ receivedSprites }) {
for (let sprite of receivedSprites) {
sprite.applyStyles({
zIndex: (receivedSprites.length - receivedSprites.indexOf(sprite)) * 100
});
move(sprite);
scale(sprite);
}
},
removedSprites.forEach(sprite => {
sprite.endAtPixel({ x: window.outerWidth });
move(sprite);
});
},
this.keptSprites.forEach(s => this.animate(new Move(s)));
}
yield sentSprites.forEach(sprite => {
scale(sprite);
move(sprite);
});
removedSprites.forEach(sprite => {
sprite.endAtSprite(beacons.trash);
parallel(move(sprite, scale(sprite)));
});
},
removedSprites.forEach(sprite => {
sprite.applyStyles({ 'z-index': 1 });
sprite.endAtPixel({ x: window.innerWidth * 0.8 });
move(sprite, { easing: easeIn });
});
},