本文整理汇总了TypeScript中@angular/platform-browser/src/animate/animation_builder.AnimationBuilder类的典型用法代码示例。如果您正苦于以下问题:TypeScript AnimationBuilder类的具体用法?TypeScript AnimationBuilder怎么用?TypeScript AnimationBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AnimationBuilder类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
private animationBuilder: AnimationBuilder,
private elementRef: ElementRef) {
this.cssAnimationBuilder = animationBuilder.css()
.setDuration(300)
.setToStyles({ backgroundColor: '#fff5a0' });
}
示例2: constructor
constructor(
private settingsService: SettingsService,
private routeParams: RouteParams,
private taskService: TaskService,
private animationBuilder: AnimationBuilder,
private elementRef: ElementRef) {
this.buttonLabelsMap = settingsService.labelsMap.timer;
this.fadeInAnimationBuilder = animationBuilder.css();
this.fadeInAnimationBuilder.setDuration(1000)
.setDelay(300)
.setFromStyles({ opacity: 0 })
.setToStyles({ opacity: 1 });
}
示例3: toggle
toggle(isVisible: boolean = false, showNav: boolean, navHeight?: number) {
let heightChild, item, thisElement = this._e.nativeElement;
let animation = this._ab.css();
if (showNav) {
animation.setDuration(0);
} else {
animation.setDuration(200);
}
if (navHeight === undefined) {
thisElement = this._e.nativeElement.childNodes[4];
if (this._e.nativeElement.childNodes[4].tagName === 'UL') {
heightChild = thisElement.childNodes[2].clientHeight;
} else {
return;
}
item = thisElement.children.length;
if (isVisible) {
animation
.setFromStyles({height: '0'})
.setToStyles({height: heightChild * item + 'px'});
} else {
animation
.setFromStyles({height: heightChild * item + 'px'})
.setToStyles({height: '0'});
}
} else {
if (!isVisible) {
animation
.setFromStyles({height: '0'})
.setToStyles({height: navHeight + 'px'});
} else {
animation
.setFromStyles({height: navHeight + 'px'})
.setToStyles({height: '0'});
}
}
animation.start(thisElement);
if (!isVisible) {
setTimeout(() => {
this._e.nativeElement.removeAttribute('style');
}, 430);
}
}
示例4: slideVertical
slideVertical(obj) {
this._ab.css()
.setDuration(300)
.setToStyles({transform: 'translateY('+obj.distance+'px)'})
.start(this.element.nativeElement);
}