Adds expand/collapse button to menu
This commit is contained in:
parent
2bc564d4fc
commit
8552c35376
|
@ -9,6 +9,10 @@
|
|||
fxLayoutAlign="center end"
|
||||
[ngClass]="{'scrolling': isScrolling}"
|
||||
>
|
||||
<button mat-fab (click)="toggleMenu()" class="toggle-menu" color="primary">
|
||||
<mat-icon *ngIf="!isScrolling">menu</mat-icon>
|
||||
<mat-icon *ngIf="isScrolling">close</mat-icon>
|
||||
</button>
|
||||
<a
|
||||
*ngFor="let link of menuLinks"
|
||||
mat-button
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
right: 0px;
|
||||
}
|
||||
|
||||
button.toggle-menu {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
transition: all 1s ease-in-out 0.5s;
|
||||
|
||||
|
|
|
@ -79,4 +79,8 @@ export class AppComponent implements AfterViewInit {
|
|||
}, 2000);
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
this.isScrolling = !this.isScrolling;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue