【发布时间】:2019-12-06 10:30:49
【问题描述】:
当我点击链接时,我想从底部开始制作动画。下面是我想要实现的图像。单击链接时,整个“红色”部分应具有动画效果并来自底部。为了实现这一点,我所做的是:
我尝试的是:
@Component({
selector: 'mypage',
templateUrl: './mypage.component.html',
styleUrls: ['./mypage.component.scss'],
animations: [
trigger('slideInOut', [
state('flyIn', style({
transform: 'translateX(0)'
})),
transition(':enter', [
style({
transform: 'translateX(-100%)'
}),
animate('0.5s 300ms ease-in')
]),
transition(':leave', [
animate('0.3s ease-out', style({
transform: 'translateX(100%)'
}))
])
])
],
});
animationState = "flyIn";
dataRefresh(id) {
this.animationState = 'flyIn';
}
<div [@slideInOut]="animationState">
<!-- Here is other page content, which I need to animate from bottom -->
<div class="col-lg-10 col-md-10 col-10" (click)="dataRefresh(id)">
<div class="row">
<div class="col-lg-12 col-md-12 col-12">
<div class="branch_row_padding">
<div class="">Name</div>
<div class="">Description</div>
</div>
</div>
</div>
</div>
</div>
通过上面的尝试,只有链接 div 从左侧动画,我想为整个页面制作动画。
对此有什么可能的解决方案?
【问题讨论】:
标签: html css angular typescript angular-animations