/
index.ios.js
99 lines (82 loc) · 1.92 KB
/
index.ios.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
Image,
Dimensions,
} from 'react-native';
import FXBlurView from 'react-native-fxblurview'
const {
width: DEVICE_WIDTH,
height: DEVICE_HEIGHT,
} = Dimensions.get('window');
class FXBlurViewExample extends Component {
constructor(props) {
super(props);
this.state = {
// blurEnabled: false,
// blurRadius: 0,
blurEnabled: true,
blurRadius: 10,
};
}
componentDidMount() {
setInterval(() => {
this.setState({
blurEnabled: !this.state.blurEnabled,
blurRadius: this.state.blurRadius + 1,
})
}, 1000)
}
render() {
return (
<View style={styles.container}>
<FXBlurView
blurRadius={this.state.blurRadius}
blurEnabled={this.state.blurEnabled}
dynamic={true}
style={styles.container}>
<Image
source={require('./Tycho-Dive-C.png')}
resizeMode="contain" />
</FXBlurView>
<View style={styles.overlay}>
<Text style={styles.text}>
Tycho - Dive
</Text>
<Text style={[styles.text, {fontSize: 14}]}>
{ "Dive is the third album by the electronica artist Tycho. Released November 8, 2011 on Ghostly International." }
</Text>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'transparent',
},
overlay: {
width: 320,
position: 'absolute',
top: 250,
left: (DEVICE_WIDTH / 2) - (320 / 2),
},
text: {
fontSize: 20,
color: 'white',
textAlign: 'center',
margin: 10,
},
});
AppRegistry.registerComponent('FXBlurViewExample', () => FXBlurViewExample);