-
Notifications
You must be signed in to change notification settings - Fork 46
/
Animations.js
77 lines (68 loc) · 2.05 KB
/
Animations.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
'use strict';
// Scene Config
var {Navigator,Dimensions,PixelRatio} = require('react-native');
var buildStyleInterpolator = require('react-native/Libraries/Utilities/buildStyleInterpolator');
var FlatFloatFromRight = Object.assign({}, Navigator.SceneConfigs.FloatFromRight);
var FlatFloatFromBottom = Object.assign({}, Navigator.SceneConfigs.FloatFromBottom);
FlatFloatFromRight.gestures = {};
var FlatFadeToTheLeft = {
transformTranslate: {
from: {x: 0, y: 0, z: 0},
to: {x: -Math.round(Dimensions.get('window').width * 0.3), y: 0, z: 0},
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
opacity: {
from: 1,
to: 0.3,
min: 0,
max: 1,
type: 'linear',
extrapolate: false,
round: 100,
},
translateX: {
from: 0,
to: -Math.round(Dimensions.get('window').width * 0.3),
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
};
var FlatFadeToTheUp = {
opacity: {
value: 1.0,
type: 'constant',
},
translateY: {
from: 0,
to: -Math.round(Dimensions.get('window').height * 0.3),
min: 0,
max: 1,
type: 'linear',
extrapolate: true,
round: PixelRatio.get(),
},
};
FlatFloatFromBottom.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheUp);
FlatFloatFromRight.animationInterpolators.out = buildStyleInterpolator(FlatFadeToTheLeft);
var None = {
gestures: {
},
// Rebound spring parameters when transitioning FROM this scene
springFriction: 0,
springTension: 2000,
// Velocity to start at when transitioning without gesture
defaultTransitionVelocity: 1.5,
// Animation interpolators for horizontal transitioning:
animationInterpolators: {
into: buildStyleInterpolator(FlatFadeToTheUp),
out: buildStyleInterpolator(FlatFadeToTheUp),
},
};
module.exports = {FlatFloatFromRight, FlatFloatFromBottom, None};