euracle commited on
Commit
dd95b9e
·
verified ·
1 Parent(s): 27f8c6e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +65 -17
app.py CHANGED
@@ -83,24 +83,9 @@ st.markdown("""
83
  </style>
84
  """, unsafe_allow_html=True)
85
 
86
- # Add header image with custom styling
87
- st.image(HEADER_IMAGE, use_column_width=True, output_format="JPEG", clamp=True)
88
 
89
- # Create main layout with columns for better organization
90
- col1, col2 = st.columns([3, 1])
91
-
92
- with col1:
93
- st.title("🌿 Dr. Radha: AI-Powered Organic Farming Consultant")
94
- st.subheader("Specializing in Agro-Homeopathy | Free Consultation")
95
-
96
- with col2:
97
- st.image(SIDE_IMAGE, width=200)
98
-
99
- # Add information section with decorative middle image
100
- st.markdown("---")
101
- col1, col2, col3 = st.columns([1, 2, 1])
102
- with col2:
103
- st.image(FOOTER_IMAGE, width=300)
104
 
105
  st.markdown("""
106
  Please provide complete details about the issue, including:
@@ -261,3 +246,66 @@ if submit_button and query:
261
 
262
  st.markdown("---")
263
  st.session_state["query"] = ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  </style>
84
  """, unsafe_allow_html=True)
85
 
 
 
86
 
87
+ st.title("🌿 Dr. Radha: AI-Powered Organic Farming Consultant")
88
+ st.subheader("Specializing in Agro-Homeopathy | Free Consultation")
 
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
  st.markdown("""
91
  Please provide complete details about the issue, including:
 
246
 
247
  st.markdown("---")
248
  st.session_state["query"] = ""
249
+
250
+ # Add this to your imports
251
+ import base64
252
+ from itertools import cycle
253
+ import time
254
+
255
+ # Add this function after your imports
256
+ def create_image_carousel(image_paths, height=200):
257
+ # Create columns for the carousel
258
+ cols = st.columns(3)
259
+
260
+ # Create cyclic iterators for images
261
+ iterators = [cycle(image_paths) for _ in range(3)]
262
+
263
+ # Offset each iterator
264
+ for i in range(3):
265
+ for _ in range(i):
266
+ next(iterators[i])
267
+
268
+ # Place in session state if not exists
269
+ if 'carousel_indices' not in st.session_state:
270
+ st.session_state.carousel_indices = [0, 1, 2]
271
+
272
+ # Display images
273
+ for idx, col in enumerate(cols):
274
+ with col:
275
+ current_image = next(iterators[idx])
276
+ st.image(current_image, use_column_width=True, caption=f"Image {idx+1}")
277
+
278
+ # Add this before the form section in your main code
279
+ st.markdown("---")
280
+ st.subheader("Our Organic Farming Solutions")
281
+
282
+ # Define your image paths
283
+ carousel_images = [
284
+ "i1.jpg",
285
+ "i2.JPG",
286
+ "i3.JPG",
287
+ ]
288
+
289
+ # Create and display the carousel
290
+ create_image_carousel(carousel_images)
291
+
292
+ # Add CSS for carousel styling
293
+ st.markdown("""
294
+ <style>
295
+ .carousel-image {
296
+ border-radius: 10px;
297
+ transition: transform 0.3s ease;
298
+ box-shadow: 0 4px 6px rgba(0,0,0,0.1);
299
+ }
300
+ .carousel-image:hover {
301
+ transform: scale(1.05);
302
+ }
303
+ /* Add spacing between carousel and form */
304
+ form {
305
+ margin-top: 2rem;
306
+ }
307
+ </style>
308
+ """, unsafe_allow_html=True)
309
+
310
+
311
+