本文整理匯總了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);
}