-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathSectionWipes2.js
84 lines (73 loc) · 1.7 KB
/
SectionWipes2.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// @flow
import React from 'react';
import styled from 'styled-components';
import { Controller, Scene } from 'react-scrollmagic';
import { Tween, Timeline } from 'react-gsap';
const SectionWipes2Styled = styled.div`
overflow: hidden;
#pinContainer {
height: 100vh;
width: 100vw;
overflow: hidden;
}
#pinContainer .panel {
height: 100vh;
width: 100vw;
position: absolute;
text-align: center;
}
.panel span {
position: relative;
display: block;
top: 50%;
font-size: 80px;
}
.panel.blue {
background-color: #3883d8;
}
.panel.turqoise {
background-color: #38ced7;
}
.panel.green {
background-color: #22d659;
}
.panel.bordeaux {
background-color: #953543;
}
`;
const SectionWipes2 = () => (
<SectionWipes2Styled>
<Controller>
<Scene
triggerHook="onLeave"
duration="300%"
pin
>
<Timeline
wrapper={<div id="pinContainer" />}
>
<section className="panel blue"><span>Panel</span></section>
<Tween
from={{ x: '-100%' }}
to={{ x: '0%' }}
>
<section className="panel turqoise"><span>Panel</span></section>
</Tween>
<Tween
from={{ x: '100%' }}
to={{ x: '0%' }}
>
<section className="panel green"><span>Panel</span></section>
</Tween>
<Tween
from={{ y: '-100%' }}
to={{ y: '0%' }}
>
<section className="panel bordeaux"><span>Panel</span></section>
</Tween>
</Timeline>
</Scene>
</Controller>
</SectionWipes2Styled>
);
export default SectionWipes2;