-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeScreen.js
89 lines (82 loc) · 2.36 KB
/
HomeScreen.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
// App.js or HomeScreen.js
import React from 'react';
import { View, Text, Button, StyleSheet, ImageBackground, TouchableOpacity } from 'react-native';
const HomeScreen = ({ navigation }) => {
return (
<ImageBackground
source={{ uri: 'https://wallpapershome.com/images/pages/ico_v/26760.jpg' }}
style={styles.background}
>
<View style={styles.container}>
<Text style={styles.title}>Prediction Options</Text>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate('RainfallPrediction')}
>
<Text style={styles.buttonText}>Rainfall Prediction</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate('YieldPrediction')}
>
<Text style={styles.buttonText}>Crop Yield Prediction</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate('CropRecommendation')}
>
<Text style={styles.buttonText}>Crop Recommendation</Text>
</TouchableOpacity>
<TouchableOpacity
style={styles.button}
onPress={() => navigation.navigate('PlantDiseasePrediction')}
>
<Text style={styles.buttonText}>Plant Disease Prediction</Text>
</TouchableOpacity>
</View>
</ImageBackground>
);
};
const styles = StyleSheet.create({
background: {
width: '100%',
height: '100%',
},
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 20,
backgroundColor: 'rgba(0, 0, 0, 0.5)', // Semi-transparent background
},
title: {
fontSize: 28,
color: '#ffffff',
textAlign: 'center',
marginBottom: 40,
fontWeight: 'bold',
textShadowColor: '#000',
textShadowOffset: { width: 2, height: 2 },
textShadowRadius: 5,
},
button: {
backgroundColor: '#4CAF50',
paddingVertical: 15,
paddingHorizontal: 20,
borderRadius: 10,
marginBottom: 20,
width: '80%',
alignItems: 'center',
shadowColor: '#000',
shadowOffset: { width: 0, height: 5 },
shadowOpacity: 0.8,
shadowRadius: 10,
elevation: 5, // Adds a shadow effect on Android
},
buttonText: {
color: '#ffffff',
fontSize: 18,
fontWeight: '600',
},
});
export default HomeScreen;