Mujtaba29 commited on
Commit
e61851e
Β·
verified Β·
1 Parent(s): 6d6075d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -27
app.py CHANGED
@@ -33,27 +33,31 @@ def get_recycling_suggestions_from_groq(item, quantity):
33
  )
34
  return chat_completion.choices[0].message.content
35
 
36
- # Sidebar for Navigation
37
  st.sidebar.title("🌍 RecycleSmart-PK")
 
 
 
38
  st.sidebar.markdown("### Navigation")
39
  section = st.sidebar.radio(
40
  "Choose a section:",
41
- ["Home", "Recycle Suggestions", "Carbon Impact", "FAQs"]
42
  )
43
- st.sidebar.markdown("---")
44
- st.sidebar.image("https://media.giphy.com/media/26xBI73gWquCBBCDe/giphy.gif", use_column_width=True)
45
 
46
- # Main Content Based on Section
47
  if section == "Home":
48
  st.title("♻️ Welcome to RecycleSmart-PK!")
49
  st.markdown(
50
  """
51
  ### 🌟 Your Smart Recycling Assistant 🌟
52
- Transform your clutter into profits while saving the planet.
53
  Select items to recycle, get creative suggestions, and see how much COβ‚‚ you can reduce!
54
  """
55
  )
56
- st.image("https://media.giphy.com/media/3oEjI6SIIHBdRxXI40/giphy.gif", use_column_width=True)
 
 
 
57
 
58
  elif section == "Recycle Suggestions":
59
  st.title("πŸ’‘ Recycling Suggestions")
@@ -61,7 +65,7 @@ elif section == "Recycle Suggestions":
61
  "πŸ“¦ Select items to recycle:",
62
  list(carbon_reduction_data.keys())
63
  )
64
- quantities = {item: st.number_input(f"Enter quantity for {item} (in kg):", min_value=0, step=1, format="%d") for item in selected_items}
65
 
66
  if st.button("Get Suggestions"):
67
  if selected_items:
@@ -76,30 +80,12 @@ elif section == "Recycle Suggestions":
76
  st.write(f"πŸ’‘ {llm_response}")
77
  st.write(f"🌍 **Carbon Footprint Reduction**: {carbon_reduction:.2f} kg COβ‚‚")
78
  st.markdown("---")
79
-
80
  st.write("### 🌟 Total Carbon Footprint Reduction 🌟")
81
  st.write(f"🌍 **{total_carbon_reduction:.2f} kg COβ‚‚ saved**")
82
  st.success("πŸŽ‰ Great job contributing to a greener planet!")
83
  else:
84
  st.error("❗ Please select at least one item and specify its quantity.")
85
 
86
- elif section == "Carbon Impact":
87
- st.title("🌍 Carbon Impact Analysis")
88
- st.markdown(
89
- """
90
- ### 🌿 Why Recycling Matters
91
- Recycling reduces waste in landfills, conserves natural resources, and lowers greenhouse gas emissions.
92
- """
93
- )
94
- st.image("https://media.giphy.com/media/l4FGn8AsM9v6KAcYE/giphy.gif", use_column_width=True)
95
- st.markdown(
96
- """
97
- #### πŸ’‘ Fun Fact:
98
- Recycling one ton of plastic bottles saves **3.8 tons of COβ‚‚**!
99
- Imagine the difference you can make!
100
- """
101
- )
102
-
103
  elif section == "FAQs":
104
  st.title("πŸ€” FAQs")
105
  st.markdown(
@@ -115,7 +101,11 @@ elif section == "FAQs":
115
  A: Visit local recycling centers or community initiatives.
116
  """
117
  )
118
- st.image("https://media.giphy.com/media/3ohzdQ1IynzclJldUQ/giphy.gif", use_column_width=True)
 
 
 
 
119
 
120
 
121
 
 
33
  )
34
  return chat_completion.choices[0].message.content
35
 
36
+ # Sidebar with a relevant GIF and navigation
37
  st.sidebar.title("🌍 RecycleSmart-PK")
38
+ st.sidebar.image(
39
+ "https://media.giphy.com/media/26xBI73gWquCBBCDe/giphy.gif", use_container_width=True
40
+ )
41
  st.sidebar.markdown("### Navigation")
42
  section = st.sidebar.radio(
43
  "Choose a section:",
44
+ ["Home", "Recycle Suggestions", "FAQs"]
45
  )
 
 
46
 
47
+ # Main Content
48
  if section == "Home":
49
  st.title("♻️ Welcome to RecycleSmart-PK!")
50
  st.markdown(
51
  """
52
  ### 🌟 Your Smart Recycling Assistant 🌟
53
+ Start reducing waste and improving the planet.
54
  Select items to recycle, get creative suggestions, and see how much COβ‚‚ you can reduce!
55
  """
56
  )
57
+ st.image(
58
+ "https://media.giphy.com/media/3oEjI6SIIHBdRxXI40/giphy.gif",
59
+ use_container_width=True,
60
+ )
61
 
62
  elif section == "Recycle Suggestions":
63
  st.title("πŸ’‘ Recycling Suggestions")
 
65
  "πŸ“¦ Select items to recycle:",
66
  list(carbon_reduction_data.keys())
67
  )
68
+ quantities = {item: st.number_input(f"Enter quantity for {item} (in kg):", min_value=0, step=1) for item in selected_items}
69
 
70
  if st.button("Get Suggestions"):
71
  if selected_items:
 
80
  st.write(f"πŸ’‘ {llm_response}")
81
  st.write(f"🌍 **Carbon Footprint Reduction**: {carbon_reduction:.2f} kg COβ‚‚")
82
  st.markdown("---")
 
83
  st.write("### 🌟 Total Carbon Footprint Reduction 🌟")
84
  st.write(f"🌍 **{total_carbon_reduction:.2f} kg COβ‚‚ saved**")
85
  st.success("πŸŽ‰ Great job contributing to a greener planet!")
86
  else:
87
  st.error("❗ Please select at least one item and specify its quantity.")
88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  elif section == "FAQs":
90
  st.title("πŸ€” FAQs")
91
  st.markdown(
 
101
  A: Visit local recycling centers or community initiatives.
102
  """
103
  )
104
+ st.image(
105
+ "https://media.giphy.com/media/3ohzdQ1IynzclJldUQ/giphy.gif",
106
+ use_container_width=True,
107
+ )
108
+
109
 
110
 
111