Hi have a div which has 6 elements, with two buttons Left N Right, as per below image
On Click of Left, I have to animate like
Remove --> Right to Left
Add --> Left to Right
Also On Click of Right icon have to animate like
Remove --> Left to Right
Add --> Right to Left
Below is my code which works for animating Right Button but how to do vice-versa
my Animation Logic
animations: [
trigger("slideInOut", [
transition(":enter", [
style({ transform: "translateX(100%)" }),
animate("400ms ease-out", style({ transform: "translateX(0%)" }))
]),
transition(":leave", [
animate("400ms ease-in", style({ transform: "translateX(-100%)" }))
])
])
];
Respective HTML
<div fxLayout="row" *ngIf="!HideSociety" [@slideInOut]>
<mat-card class="collection-boxdata" *ngFor="let obj of SocConnArray">
<mat-card-title>
<span>{{obj.Date | date:'dd/MM/yyyy'}}</span>
</mat-card-title>
<mat-card-content>
<div fxLayout="row">
<div fxFlex="50" fxFlex.gt-sm="100">
<h3>Active : <span>{{obj.ConnSoc}}</span></h3>
<h3>Non Active : <span>{{obj.NonConnSoc}}</span></h3>
</div>
</div>
</mat-card-content>
</mat-card>
</div>
<div
class="mat-card-footer-content"
div
fxLayout="row"
fxLayoutAlign="center center"
>
<button mat-raised-button (click)="moveLeft()" color="primary">
<mat-icon>navigate_before</mat-icon>
</button>
<button mat-raised-button (click)="moveRIght()">
<mat-icon>navigate_next</mat-icon>
</button>
</div>
I just have to animate Left To Right on Right Button Click and Right to Left on Left button click
Thanks for any help will be grateful.