-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
127 lines (113 loc) · 4.49 KB
/
main.py
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
import streamlit as st
from home import show_home
from predict import show_predict
from analyze import show_analyze
from comparison import show_comparison
from visualization import show_visualization
from sustainability import show_sustainability
from insights import show_insights
from about import show_about
st.set_page_config(
page_title="Crop Recommendation System",
page_icon="🌾",
layout="wide",
initial_sidebar_state="expanded",
)
# Apply custom CSS for a modern look
st.markdown(
"""
<style>
/* Style the sidebar */
.sidebar .sidebar-content {
background-color: #333333;
padding: 20px;
border-radius: 10px;
}
/* Style the sidebar title */
.sidebar .sidebar-content h1 {
color: #FF5733;
text-align: center;
font-size: 30px;
}
/* Style the sidebar selectbox */
.sidebar .sidebar-content .stSelectbox label {
color: #FFFFFF;
font-size: 20px;
}
/* Style the selectbox */
.sidebar .sidebar-content .stSelectbox div[data-baseweb=select] > div {
background-color: #FF5733;
color: #FFFFFF;
font-size: 20px;
}
/* Style the selected page content */
.main .block-container {
background-color: #1C1C1C;
padding: 20px;
border-radius: 10px;
color: #FFFFFF;
}
/* General text color */
.main .block-container p, .main .block-container h1, .main .block-container h2, .main .block-container h3, .main .block-container ul, .main .block-container ol {
color: #FFFFFF;
}
</style>
""", unsafe_allow_html=True
)
# Add image to the sidebar
st.sidebar.image("closeup-shot-rice-plant-sunset-with-plantation-background.png", use_container_width =True) # Update 'sidebar_image.png' with your image file name
# Create a sidebar for navigation with a selectbox slider for main sections
st.sidebar.title("🌟 Navigation")
page = st.sidebar.selectbox("Choose a Section:",
["🏠 Home",
"🔍 Predict",
"📊 Analyze",
"🌾 Crop Comparison",
"📈 Advanced Visualization",
"🌍 Sustainability Tips",
"🌱 Crop Insights"
])
# Create a sidebar selectbox for 'About the App'
st.sidebar.title("ℹ️ About the App")
about_page = st.sidebar.selectbox("Learn More:",
["Overview", "Features", "How It Works", "Credits"])
# Display the selected page for main sections
if page == "🏠 Home":
show_home()
elif page == "🔍 Predict":
show_predict()
elif page == "📊 Analyze":
show_analyze()
elif page == "🌾 Crop Comparison":
show_comparison()
elif page == "📈 Advanced Visualization":
show_visualization()
elif page == "🌍 Sustainability Tips":
show_sustainability()
elif page == "🌱 Crop Insights":
show_insights()
# Display the selected 'About the App' page
if about_page == "Overview":
show_about("overview")
elif about_page == "Features":
show_about("features")
elif about_page == "How It Works":
show_about("how_it_works")
elif about_page == "Credits":
show_about("credits")
# In the 'Features' section, add all the key features
def show_about(page):
if page == "features":
st.header("Key Features")
st.write("""
- **Mining Site Recommendation**: Get tailored mining site suggestions based on your preferences.
- **Predict Mining Potential**: Predict the potential of a mining site with advanced models.
- **Advanced Visualizations**: Analyze data with rich, interactive visualizations.
- **Sustainability Tips**: Learn best practices for sustainable mining.
- **Crop Comparison**: Compare crop performance under different conditions.
- **Mining Site Analysis**: In-depth analysis of various mining sites for better decision-making.
- **Interactive Insights**: Gain actionable insights with our interactive data analysis tools.
- **User-Friendly Interface**: Navigate seamlessly with our modern, intuitive UI.
""")
st.sidebar.image("rural-scene-farm-corn-crop-nature-growth-generated-by-ai.jpg", use_container_width =True)
st.image("colorful-farm-fields-from-sunflower-wheat-rye-corn.jpg", use_container_width =True)