-
Notifications
You must be signed in to change notification settings - Fork 1
/
setPageAnimate.js
36 lines (32 loc) · 974 Bytes
/
setPageAnimate.js
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
const setPageAnimate = () => {
const wrapElements = document.querySelector(".top-info-section");
if (!wrapElements) {
return false;
}
const titleElements = wrapElements.querySelectorAll(".detail-title span");
const dateElements = wrapElements.querySelector(".detail-date");
const summaryElements = wrapElements.querySelector(".detail-summary");
const informationElements = wrapElements.querySelector(".detail-bottom-information");
gsap
.timeline()
.staggerFromTo(
titleElements,
0.8,
{opacity: 0, y: '100%'},
{opacity: 1, y: '0%', delay: 0.2, ease: Power1.easeInOut},
0.05
)
.fromTo(
[summaryElements, dateElements, informationElements].filter(el => el),
{opacity: 0, y: '35px', filter: 'blur(10px)'},
{
opacity: 1,
y: '0',
filter: 'blur(0px)',
delay: 0,
ease: "power1.inOut",
duration: 0.8
}
);
}
export default setPageAnimate;