-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.component.ts
46 lines (36 loc) · 855 Bytes
/
app.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
Component,
ElementRef,
OnInit,
ViewChild,
Inject,
} from '@angular/core';
import { DOCUMENT } from '@angular/common';
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
title(title: any) {
}
@ViewChild('dropdownMenu', { static: true })
dropdownMenu!: ElementRef<HTMLDivElement>;
constructor(@Inject(DOCUMENT) private document: Document) {}
ngOnInit() {
this.animation();
}
animation(): void {
gsap.from(this.dropdownMenu.nativeElement.childNodes, {
duration: 1.5,
opacity: 0.1,
y: 50,
x: -50,
stagger: 1.2,
delay: 0.5,
});
}
}