-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
78 lines (76 loc) · 1.74 KB
/
App.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
import React from 'react';
import { ScrollView, StyleSheet, View } from 'react-native';
export default function App() {
return (
<ScrollView>
<View style={styles.container}>
<View style={styles.shape_container}>
<View style={styles.square} />
</View>
<View style={styles.shape_container}>
<View style={styles.rectangle} />
</View>
<View style={styles.shape_container}>
<View style={styles.circle} />
</View>
<View style={styles.shape_container}>
<View style={styles.oval} />
</View>
<View style={styles.shape_container}>
<View style={styles.triangle} />
</View>
</View>
</ScrollView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
alignItems: 'center',
justifyContent: 'center',
},
shape_container: {
height: 150,
alignItems: 'center',
justifyContent: 'center',
margin: 10,
},
square: {
width: 120,
height: 120,
backgroundColor: '#264653',
},
rectangle: {
width: 120 * 2,
height: 120,
backgroundColor: '#2a9d8f'
},
circle: {
width: 120,
height: 120,
borderRadius: 120 / 2,
borderColor: '#e9c46a',
borderWidth: 5,
},
oval: {
width: 120,
height: 120,
borderRadius: 60,
backgroundColor: '#f4a261',
transform: [{ scaleX: 2 }],
},
triangle: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderLeftWidth: 60,
borderRightWidth: 60,
borderBottomWidth: 120,
borderLeftColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: '#e76f51',
transform: [{ rotate: '180deg' }]
}
});