Fixed chat input and header UI
Browse files
app.py
CHANGED
@@ -229,24 +229,24 @@ st.markdown("""
|
|
229 |
}
|
230 |
|
231 |
/* Chat input styling - Fixed alignment */
|
232 |
-
.stChatInput {
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
}
|
244 |
|
245 |
-
.stChatInput:focus {
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
}
|
250 |
|
251 |
/* Chat input container */
|
252 |
.stChatInput > div {
|
@@ -255,33 +255,35 @@ st.markdown("""
|
|
255 |
}
|
256 |
|
257 |
/* Chat input text area */
|
258 |
-
.stChatInput textarea {
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
}
|
268 |
|
269 |
/* Chat input placeholder */
|
270 |
-
.stChatInput textarea::placeholder {
|
271 |
-
|
272 |
-
|
|
|
|
|
|
|
|
|
273 |
}
|
274 |
|
275 |
/* Fix the main chat input container alignment */
|
276 |
[data-testid="stChatInput"] {
|
277 |
position: fixed !important;
|
278 |
-
bottom: 0 !important;
|
279 |
-
left:
|
280 |
right: 0 !important;
|
281 |
background: #ffffff !important;
|
282 |
-
|
283 |
-
padding: 1rem !important;
|
284 |
-
z-index: 1000 !important;
|
285 |
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
|
286 |
}
|
287 |
|
@@ -290,25 +292,12 @@ st.markdown("""
|
|
290 |
padding-bottom: 100px !important;
|
291 |
}
|
292 |
|
293 |
-
# /* Alternative: If you prefer inline chat input (not fixed) */
|
294 |
-
# /*
|
295 |
-
# [data-testid="stChatInput"] {
|
296 |
-
# background: #f8fafc !important;
|
297 |
-
# border: 1px solid #e2e8f0 !important;
|
298 |
-
# border-radius: 12px !important;
|
299 |
-
# padding: 0.75rem !important;
|
300 |
-
# margin: 1rem 0 !important;
|
301 |
-
# box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
|
302 |
-
# }
|
303 |
-
# */
|
304 |
-
|
305 |
/* Chat input button styling */
|
306 |
[data-testid="stChatInput"] button {
|
307 |
background: #3b82f6 !important;
|
308 |
color: white !important;
|
309 |
border: none !important;
|
310 |
border-radius: 12px !important;
|
311 |
-
padding: 0.5rem 1rem !important;
|
312 |
font-weight: 600 !important;
|
313 |
transition: background-color 0.2s ease !important;
|
314 |
}
|
@@ -317,6 +306,17 @@ st.markdown("""
|
|
317 |
background: #2563eb !important;
|
318 |
}
|
319 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
320 |
/* Ensure proper spacing from sidebar */
|
321 |
@media (min-width: 768px) {
|
322 |
[data-testid="stChatInput"] {
|
@@ -615,28 +615,25 @@ st.markdown("""
|
|
615 |
align-items: center;
|
616 |
justify-content: center;
|
617 |
padding: 0.5rem 0;
|
618 |
-
gap:
|
619 |
-
border-bottom: 1px solid
|
620 |
-
#e5e7eb;
|
621 |
margin-bottom: 1rem;
|
622 |
'>
|
623 |
<img src='https://sustainability-lab.github.io/images/logo_light.svg'
|
624 |
style='height: 80px;' />
|
625 |
-
<
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
#
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
font-weight: 500;
|
639 |
-
'>AI Air Quality Analysis • Sustainability Lab, IIT Gandhinagar</span>
|
640 |
</div>
|
641 |
""", unsafe_allow_html=True)
|
642 |
|
|
|
229 |
}
|
230 |
|
231 |
/* Chat input styling - Fixed alignment */
|
232 |
+
# .stChatInput {
|
233 |
+
# border-radius: 12px !important;
|
234 |
+
# border: 2px solid #e5e7eb !important;
|
235 |
+
# background: #ffffff !important;
|
236 |
+
# padding: 0.75rem 1rem !important;
|
237 |
+
# font-size: 1rem !important;
|
238 |
+
# width: 100% !important;
|
239 |
+
# max-width: 70% !important;
|
240 |
+
# margin: 0 !important;
|
241 |
+
# box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
|
242 |
+
# transition: all 0.2s ease !important;
|
243 |
+
# }
|
244 |
|
245 |
+
# .stChatInput:focus {
|
246 |
+
# border-color: #3b82f6 !important;
|
247 |
+
# box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
|
248 |
+
# outline: none !important;
|
249 |
+
# }
|
250 |
|
251 |
/* Chat input container */
|
252 |
.stChatInput > div {
|
|
|
255 |
}
|
256 |
|
257 |
/* Chat input text area */
|
258 |
+
# .stChatInput textarea {
|
259 |
+
# border: none !important;
|
260 |
+
# background: transparent !important;
|
261 |
+
# padding: 0 !important;
|
262 |
+
# margin: 0 !important;
|
263 |
+
# font-size: 1rem !important;
|
264 |
+
# line-height: 1.5 !important;
|
265 |
+
# resize: none !important;
|
266 |
+
# outline: none !important;
|
267 |
+
# }
|
268 |
|
269 |
/* Chat input placeholder */
|
270 |
+
# .stChatInput textarea::placeholder {
|
271 |
+
# color: #9ca3af !important;
|
272 |
+
# font-style: normal !important;
|
273 |
+
# }
|
274 |
+
|
275 |
+
.st-emotion-cache-f4ro0r {
|
276 |
+
align-items = center;
|
277 |
}
|
278 |
|
279 |
/* Fix the main chat input container alignment */
|
280 |
[data-testid="stChatInput"] {
|
281 |
position: fixed !important;
|
282 |
+
bottom: 0.5rem !important;
|
283 |
+
left: 6rem !important;
|
284 |
right: 0 !important;
|
285 |
background: #ffffff !important;
|
286 |
+
width: 65% !important;
|
|
|
|
|
287 |
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
|
288 |
}
|
289 |
|
|
|
292 |
padding-bottom: 100px !important;
|
293 |
}
|
294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
/* Chat input button styling */
|
296 |
[data-testid="stChatInput"] button {
|
297 |
background: #3b82f6 !important;
|
298 |
color: white !important;
|
299 |
border: none !important;
|
300 |
border-radius: 12px !important;
|
|
|
301 |
font-weight: 600 !important;
|
302 |
transition: background-color 0.2s ease !important;
|
303 |
}
|
|
|
306 |
background: #2563eb !important;
|
307 |
}
|
308 |
|
309 |
+
/* Textarea inside chat input */
|
310 |
+
[data-testid="stChatInput"] [data-baseweb="textarea"] {
|
311 |
+
border: 2px solid #3b82f6 !important;
|
312 |
+
border-radius: 12px !important;
|
313 |
+
font-size: 16px !important;
|
314 |
+
color: #111 !important;
|
315 |
+
|
316 |
+
width: 100% !important; /* fill the parent container */
|
317 |
+
box-sizing: border-box !important;
|
318 |
+
}
|
319 |
+
|
320 |
/* Ensure proper spacing from sidebar */
|
321 |
@media (min-width: 768px) {
|
322 |
[data-testid="stChatInput"] {
|
|
|
615 |
align-items: center;
|
616 |
justify-content: center;
|
617 |
padding: 0.5rem 0;
|
618 |
+
gap: 12px;
|
619 |
+
border-bottom: 1px solid #e5e7eb;
|
|
|
620 |
margin-bottom: 1rem;
|
621 |
'>
|
622 |
<img src='https://sustainability-lab.github.io/images/logo_light.svg'
|
623 |
style='height: 80px;' />
|
624 |
+
<div style='display: flex; flex-direction: column; line-height: 1.2;'>
|
625 |
+
<h1 style='
|
626 |
+
margin: 0;
|
627 |
+
font-size: 1.5rem;
|
628 |
+
font-weight: 700;
|
629 |
+
color: #2563eb;
|
630 |
+
'>VayuChat</h1>
|
631 |
+
<span style='
|
632 |
+
font-size: 0.85rem;
|
633 |
+
color: #6b7280;
|
634 |
+
font-weight: 500;
|
635 |
+
'>AI Air Quality Analysis • Sustainability Lab, IIT Gandhinagar</span>
|
636 |
+
</div>
|
|
|
|
|
637 |
</div>
|
638 |
""", unsafe_allow_html=True)
|
639 |
|