Parishri07 commited on
Commit
70a19a9
Β·
verified Β·
1 Parent(s): 44adf9f

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +12 -3
src/streamlit_app.py CHANGED
@@ -4,15 +4,16 @@ from utils.reducer import suggest_reduction
4
 
5
  st.set_page_config(page_title="GreenPrint AI 🌱", layout="centered")
6
 
 
7
  st.markdown("""
8
  <h1 style='text-align: center; white-space: nowrap; overflow-x: auto; font-size: 2.2rem;'>
9
  🌿 GreenPrint AI: Carbon Footprint Detector
10
  </h1>
11
  """, unsafe_allow_html=True)
12
 
13
-
14
- # User Input
15
  with st.form("activity_form"):
 
16
  car_km = st.number_input("πŸš— Car travel per week (km)", 0, 1000, 50)
17
  electricity = st.number_input("πŸ’‘ Electricity usage per month (units)", 0, 1000, 200)
18
  meat = st.number_input("πŸ– Meat meals per week", 0, 21, 7)
@@ -20,6 +21,7 @@ with st.form("activity_form"):
20
 
21
  submitted = st.form_submit_button("Calculate")
22
 
 
23
  if submitted:
24
  user_input = {
25
  "car_km_per_week": car_km,
@@ -29,9 +31,16 @@ if submitted:
29
  }
30
 
31
  result = predict_footprint(user_input)
32
- st.success(f"Estimated Annual Carbon Footprint: **{result:.2f} kg COβ‚‚**")
33
 
34
  st.markdown("---")
35
  st.subheader("♻️ Suggestions to Reduce Your Footprint")
36
  for tip in suggest_reduction(user_input):
37
  st.markdown(f"- {tip}")
 
 
 
 
 
 
 
 
4
 
5
  st.set_page_config(page_title="GreenPrint AI 🌱", layout="centered")
6
 
7
+ # Stylish Heading (Single Line, Non-Wrapping)
8
  st.markdown("""
9
  <h1 style='text-align: center; white-space: nowrap; overflow-x: auto; font-size: 2.2rem;'>
10
  🌿 GreenPrint AI: Carbon Footprint Detector
11
  </h1>
12
  """, unsafe_allow_html=True)
13
 
14
+ # User Input Form
 
15
  with st.form("activity_form"):
16
+ st.subheader("Enter Your Weekly/Monthly/Yearly Activity Data:")
17
  car_km = st.number_input("πŸš— Car travel per week (km)", 0, 1000, 50)
18
  electricity = st.number_input("πŸ’‘ Electricity usage per month (units)", 0, 1000, 200)
19
  meat = st.number_input("πŸ– Meat meals per week", 0, 21, 7)
 
21
 
22
  submitted = st.form_submit_button("Calculate")
23
 
24
+ # Prediction & Suggestions
25
  if submitted:
26
  user_input = {
27
  "car_km_per_week": car_km,
 
31
  }
32
 
33
  result = predict_footprint(user_input)
34
+ st.success(f"🌍 Estimated Annual Carbon Footprint: **{result:.2f} kg COβ‚‚**")
35
 
36
  st.markdown("---")
37
  st.subheader("♻️ Suggestions to Reduce Your Footprint")
38
  for tip in suggest_reduction(user_input):
39
  st.markdown(f"- {tip}")
40
+
41
+ # Footer
42
+ st.markdown("---")
43
+ st.markdown(
44
+ "<div style='text-align: center; font-size: 16px;'>Made with πŸ’š by Parishri</div>",
45
+ unsafe_allow_html=True
46
+ )