1- import { animate , group , query , sequence , state , style , transition , trigger } from '@angular/animations' ;
21import { ChangeDetectionStrategy , Component , inject , InjectionToken } from '@angular/core' ;
32import { MenuItem } from '../../services/navigation.service' ;
43import { RouterLink , RouterLinkActive } from '@angular/router' ;
@@ -18,26 +17,6 @@ export const APP_MENU_DATA = new InjectionToken<MenuDropdownData>('MenuDropdownD
1817 styleUrl : './menu.component.scss' ,
1918 changeDetection : ChangeDetectionStrategy . OnPush ,
2019 preserveWhitespaces : false ,
21- animations : [
22- trigger ( 'transformMenu' , [
23- state ( 'void' , style ( { opacity : 0 , transform : 'scale(0.01, 0.01)' } ) ) ,
24- transition (
25- 'void => enter' ,
26- sequence ( [
27- query ( '.mega-menu-content' , style ( { opacity : 0 } ) ) ,
28- animate ( '100ms linear' , style ( { opacity : 1 , transform : 'scale(1, 0.5)' } ) ) ,
29- group ( [
30- query (
31- '.mega-menu-content' ,
32- animate ( '402ms cubic-bezier(0.55, 0, 0.55, 0.2)' , style ( { opacity : 1 } ) ) ,
33- ) ,
34- animate ( '300ms cubic-bezier(0.25, 0.8, 0.25, 1)' , style ( { transform : 'scale(1, 1)' } ) ) ,
35- ] ) ,
36- ] ) ,
37- ) ,
38- transition ( '* => void' , animate ( '150ms 50ms linear' , style ( { opacity : 0 } ) ) ) ,
39- ] ) ,
40- ] ,
4120 imports : [ CommonModule , RouterLinkActive , RouterLink ] ,
4221} )
4322export class MenuComponent {
@@ -48,21 +27,12 @@ export class MenuComponent {
4827 */
4928 public offsetLeft = 0 ;
5029
51- /**
52- * Current state of the panel animation.
53- */
54- public panelAnimationState : 'void' | 'enter' = 'void' ;
55-
5630 public constructor ( ) {
5731 const data = this . data ;
5832
5933 this . offsetLeft = data . originalNativeElement . offsetLeft - 20 ;
6034 }
6135
62- public startAnimation ( ) : void {
63- this . panelAnimationState = 'enter' ;
64- }
65-
6636 /**
6737 * Toggle open parent nodes, and allow navigation only on children
6838 */
0 commit comments