-
Notifications
You must be signed in to change notification settings - Fork 26.1k
/
index.tsx
53 lines (51 loc) · 1.06 KB
/
index.tsx
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
46
47
48
49
50
51
52
53
import { CSSTransition } from 'react-transition-group'
import { gsap } from 'gsap'
import Home from '../components/Home'
export default function HomePage() {
const onEnter = (node: any) => {
gsap.from(
[node.children[0].firstElementChild, node.children[0].lastElementChild],
0.6,
{
y: 30,
delay: 0.6,
ease: 'power3.InOut',
opacity: 0,
stagger: {
amount: 0.6,
},
}
)
}
const onExit = (node: any) => {
gsap.to(
[node.children[0].firstElementChild, node.children[0].lastElementChild],
0.6,
{
y: -30,
ease: 'power3.InOut',
stagger: {
amount: 0.2,
},
}
)
}
return (
<>
<div className="container">
<CSSTransition
in={true}
timeout={1200}
classNames="page"
onExit={onExit}
onEntering={onEnter}
unmountOnExit
>
<div className="page">
<Home />
</div>
</CSSTransition>
</div>
</>
)
}