I have an array that gets constantly updated, for every new entry I want to animate it. So I wrote this function:
animateUserInput() {
let userMsgLength = document.getElementsByClassName('usermessage').length;
let lastElement;
setTimeout(() => {
lastElement = document.getElementsByClassName('usermessage')[userMsgLength];
if(lastElement){
const myAnimation = this.builder.build([
sequence([
animate('200ms 500ms ease-out', style({
opacity: 0,
top:'-120px'
})), animate('0ms 101ms',style({
fontSize: 16,
textAlign: 'right',
top: '-100px'
})),
animate('0ms 100ms ease-in',style({
opacity: 1,
top:'-130px'
}))
])
]);
// then create a player from it
const player = myAnimation.create(lastElement);
player.play();
}
}, 0)
}
If I compile this with Ionic serve, it will work just fine. But If I build it on my devie (iPhone) the animation won't work. I've been trying for hours and don't know what to do anymore. Any suggestions?