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 => {
// 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);
});
}
import Controller from '@ember/controller';
import adjustColor from 'ember-animated/motions/adjust-color';
import boxShadow from 'ember-animated/motions/box-shadow';
const backgroundColor = adjustColor.property('background-color');
export default class extends Controller {
*transition({ receivedSprites }) {
receivedSprites.forEach(backgroundColor);
receivedSprites.forEach(boxShadow);
}
}
motions() {
let motions = [];
if (!this.disableMove) {
motions.push(move);
}
if (!this.disableCompensateForScale) {
motions.push(compensateForScale);
}
if (!this.disableAdjustFontSize) {
motions.push(adjustCSS.property('font-size'));
}
if (!this.disableAdjustLetterSpacing) {
motions.push(adjustCSS.property('letter-spacing'));
}
if (!this.disableAdjustColor) {
motions.push(adjustColor.property('color'));
}
return motions;
},
transition: function * ({ sentSprites }) {
sentSprites.forEach(
parallel(
move,
compensateForScale,
adjustCSS.property('font-size'),
adjustCSS.property('letter-spacing'),
adjustColor.property('color')
)
);
}
}).reopenClass({