-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
220 lines (215 loc) · 8.18 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
// https://github.com/tokkozhin/react-native-neomorph-shadows
import React, { Component } from 'react'
import { Text, TouchableOpacity, View, Switch } from 'react-native'
import { Neomorph } from 'react-native-neomorph-shadows';
import Icon from 'react-native-vector-icons/Ionicons'
import Prova from './prova'
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
pressStatus: false,
isEnabled: false
};
}
render() {
return (
<View style={{flex:1, backgroundColor: "#E3EDF7"}}>
<View style={{flexDirection: "row", alignItems: "center", justifyContent: "space-between", margin: 15}}>
<Text style={{fontSize: 30, color: "#31456A", fontWeight: "bold"}}>Clock</Text>
<TouchableOpacity onPress={()=>this.setState({pressStatus: !this.state.pressStatus})}>
<Neomorph
inner={this.state.pressStatus} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 25,
backgroundColor: '#E3EDF7',
width: 50,
height: 50,
alignItems: "center",
justifyContent: "center"
}}
>
<Icon name="settings-sharp" size={30} color="#31456A"/>
</Neomorph>
</TouchableOpacity>
</View>
<View style={{alignItems: "center"}}>
<Neomorph
style={{
shadowRadius: 3,
borderRadius: 100,
backgroundColor: '#E3EDF7',
width: 200,
height: 200,
justifyContent: 'center',
alignItems: 'center',
}}
>
<Neomorph
inner
style={{
shadowRadius: 7,
borderRadius: 90,
backgroundColor: '#E3EDF7',
width: 180,
height: 180,
justifyContent: 'center',
alignItems: 'center',
}}
>
<Neomorph
style={{
shadowRadius: 7,
borderRadius: 50,
backgroundColor: '#E3EDF7',
width: 100,
height: 100,
alignItems: "center",
justifyContent: "center"
}}
>
<Prova/>
{/* <View style={{backgroundColor: "red", width: 1, height:"45%"}}/> */}
</Neomorph>
</Neomorph>
</Neomorph>
</View>
<View style={{alignItems: "center"}}>
<Neomorph
//inner={this.state.pressStatus} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 10,
backgroundColor: '#E3EDF7',
width: 250,
height: 50,
flexDirection: "row",
alignItems: "center",
justifyContent: "space-evenly",
marginVertical: 20
}}
>
<Text style={{fontSize: 25, fontWeight: "bold", color: "#31456A"}}>05:00</Text>
<Text style={{marginLeft: 2}}>a.m.</Text>
<Switch
trackColor={{ false: "#DEE8F2", true: "#B9CEE2" }}
thumbColor={this.state.isEnabled ? "#31456A" : "#E3EDF7"}
ios_backgroundColor="#3e3e3e"
onValueChange={() => this.setState({isEnabled: !this.state.isEnabled})}
value={this.state.isEnabled}
/>
</Neomorph>
<Neomorph
//inner={this.state.pressStatus} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 10,
backgroundColor: '#E3EDF7',
width: 250,
height: 50,
flexDirection: "row",
alignItems: "center",
justifyContent: "space-evenly"
}}
>
<Text style={{fontSize: 25, fontWeight: "bold", color: "#31456A"}}>07:30</Text>
<Text style={{marginLeft: 2}}>p.m.</Text>
<Switch
trackColor={{ false: "#DEE8F2", true: "#B9CEE2" }}
thumbColor={this.state.isEnabled ? "#31456A" : "#E3EDF7"}
ios_backgroundColor="#3e3e3e"
onValueChange={() => this.setState({isEnabled: !this.state.isEnabled})}
value={this.state.isEnabled}
/>
</Neomorph>
</View>
<View style={{width: '100%',marginVertical: 20, flexDirection: "row", alignItems: "center", justifyContent: "space-evenly", position: "absolute", bottom: 0}}>
<TouchableOpacity>
<Neomorph
inner={false} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 20,
backgroundColor: '#E3EDF7',
width: 70,
height: 70,
alignItems: "center",
justifyContent: "center"
}}
>
<View style={{flexDirection: "column", alignItems: "center"}}>
<Icon name="alarm-outline" size={30} color="#31456A"/>
<Text style={{fontWeight: "bold", color: "#31456A", fontSize: 12}}>Alarm</Text>
</View>
</Neomorph>
</TouchableOpacity>
<TouchableOpacity>
<Neomorph
inner={false} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 20,
backgroundColor: '#E3EDF7',
width: 70,
height: 70,
alignItems: "center",
justifyContent: "center"
}}
>
<View style={{flexDirection: "column", alignItems: "center"}}>
<Icon name="globe-outline" size={30} color="#31456A"/>
<Text style={{fontWeight: "bold", color: "#31456A", fontSize: 12}}>World clock</Text>
</View>
</Neomorph>
</TouchableOpacity>
<TouchableOpacity>
<Neomorph
inner={false} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 20,
backgroundColor: '#E3EDF7',
width: 70,
height: 70,
alignItems: "center",
justifyContent: "center"
}}
>
<View style={{flexDirection: "column", alignItems: "center"}}>
<Icon name="timer-outline" size={30} color="#31456A"/>
<Text style={{fontWeight: "bold", color: "#31456A", fontSize: 12}}>Stopwatch</Text>
</View>
</Neomorph>
</TouchableOpacity>
<TouchableOpacity>
<Neomorph
inner={false} // <- enable shadow inside of neomorph
swapShadows // <- change zIndex of each shadow color
style={{
shadowRadius: 10,
borderRadius: 20,
backgroundColor: '#E3EDF7',
width: 70,
height: 70,
alignItems: "center",
justifyContent: "center"
}}
>
<View style={{flexDirection: "column", alignItems: "center"}}>
<Icon name="hourglass-outline" size={30} color="#31456A"/>
<Text style={{fontWeight: "bold", color: "#31456A", fontSize: 12}}>Timer</Text>
</View>
</Neomorph>
</TouchableOpacity>
</View>
</View>
)
}
}