mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-04-18 14:22:35 +00:00
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import { Component, ElementRef, HostBinding, OnInit } from '@angular/core';
|
|
import { style, animate, sequence, AnimationBuilder, AnimationPlayer } from '@angular/animations';
|
|
import { AppComponent } from '../../../app.component';
|
|
|
|
@Component({
|
|
selector : 'fuse-sidenav',
|
|
templateUrl: './sidenav.component.html',
|
|
styleUrls : ['./sidenav.component.scss']
|
|
})
|
|
export class SidenavComponent implements OnInit
|
|
{
|
|
constructor(private elementRef: ElementRef,
|
|
private animationBuilder: AnimationBuilder,
|
|
private bodyEl: AppComponent)
|
|
{
|
|
|
|
}
|
|
|
|
closeBar()
|
|
{
|
|
this.animationBuilder
|
|
.build([
|
|
style({transform: 'translate3d(0,0,0)'}),
|
|
animate('400ms ease', style({transform: 'translate3d(100%,0,0)'}))
|
|
])
|
|
.create(this.elementRef.nativeElement)
|
|
.play();
|
|
}
|
|
|
|
openBar()
|
|
{
|
|
this.animationBuilder
|
|
.build([
|
|
style({transform: 'translate3d(100%,0,0)'}),
|
|
animate('400ms ease', style({transform: 'translate3d(0,0,0)'}))
|
|
])
|
|
.create(this.elementRef.nativeElement)
|
|
.play();
|
|
}
|
|
|
|
ngOnInit()
|
|
{
|
|
}
|
|
|
|
}
|