I have a transition defined like this:
transition('show-content => hide-content', [
query('.project-view-item', [
style({
opacity: 1,
transform: 'translateX(0px)'
}),
stagger('0.3s', [
animate(
'0.2s',
keyframes([
style({
opacity: 0,
transform: 'translateX(-40px)',
offset: 1
})
])
)
])
])
])
Everything works as expected. The items go to left and fade-out. The problem is that after all items becomes hidden the style is reset and they become visible again all at once. It's like I need to have that css3 property called animation-fill-mode: forwards
.
How can I do that in angular ? How can I retain last state of animation ?
Animation start and animation done will help here:
HTML
Typescript:
Demo