-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathOverlay.js
48 lines (46 loc) · 1.12 KB
/
Overlay.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
import React, { Component } from 'react';
import { VelocityTransitionGroup } from 'velocity-react';
import Switcher from 'switcheroo';
export default class Overlay extends Component {
closeOverlay(e) {
window.location.hash = '/';
}
render() {
var Animations = {
slideUpIn: {
animation: {
translateY: 0
},
style: {
translateY: '100%'
},
duration: 300,
easing: 'ease-in'
},
slideUpOut: {
animation: {
translateY: '100%'
},
style: {
translateY: 0
},
duration: 300,
easing: 'ease-out'
}
};
return (
<Switcher
wrapper={VelocityTransitionGroup}
enter={Animations.slideUpIn}
leave={Animations.slideUpOut}
>
<div path="/route2" className="overlay">
<div className="overlay-close" onClick={this.closeOverlay}>Close</div>
<h1 className="overlay-header">
Full screen overlay was animated using JavaScript animations via velocity-react!!
</h1>
</div>
</Switcher>
);
}
}