I have been experimenting with creating a simple animation, and it's working, but in the opposite direction of what I intended. I want the div to open from bottom to top and close from top to bottom.
Here is my animation code in Angular:
animations: [
trigger('inOutAnimation', [
transition(':enter', [
style({ height: 0, opacity: 0}),
animate('1s linear ', style({ height: 318, opacity: 1 })),
]),
transition(':leave', [
style({ height: 318, opacity: 1 }),
animate('1s linear', style({ height: 0, opacity: 0 })),
]),
]),
],
The div I am animating has a position absolute while its parent has a relative position. I've tried searching online for ways to reverse the animation, but nothing like animation-direction: reverse;
seems to work. Any suggestions?