Adds expand/collapse button to menu

This commit is contained in:
Aaron Louie 2019-10-14 13:47:20 -04:00
parent 2bc564d4fc
commit 8552c35376
3 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -15,6 +15,12 @@
right: 0px;
}
button.toggle-menu {
position: fixed;
top: 20px;
right: 20px;
}
a {
transition: all 1s ease-in-out 0.5s;

View File

@ -79,4 +79,8 @@ export class AppComponent implements AfterViewInit {
}, 2000);
}
toggleMenu() {
this.isScrolling = !this.isScrolling;
}
}