jdesiree commited on
Commit
6010f51
·
verified ·
1 Parent(s): ea8ef30

Adjusting style

Browse files
Files changed (1) hide show
  1. app.py +23 -60
app.py CHANGED
@@ -164,21 +164,10 @@ def respond_with_enhanced_streaming(message, history):
164
 
165
  # --- Fixed Gradio UI and CSS ---
166
  custom_css = """
167
- /* Reset and base styling */
168
- html, body {
169
- margin: 0;
170
- padding: 0;
171
- height: 100%;
172
- }
173
-
174
  /* Main container styling */
175
  .gradio-container {
176
  background-color: rgb(240, 236, 230) !important;
177
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
178
- height: 100vh !important;
179
- max-width: none !important;
180
- margin: 0 !important;
181
- padding: 0 !important;
182
  }
183
 
184
  /* Title styling */
@@ -196,24 +185,20 @@ html, body {
196
  margin: 0;
197
  }
198
 
199
- /* Chat container - give it proper height */
200
  .chat-container {
201
- height: calc(100vh - 200px) !important;
202
- min-height: 400px !important;
203
  background-color: rgb(240, 236, 230);
204
  }
205
 
206
- /* Chatbot specific styling */
207
- .chat-container .gradio-chatbot {
208
- height: 100% !important;
209
- min-height: 400px !important;
210
- max-height: none !important;
211
  background-color: transparent !important;
212
  border: none !important;
213
  padding: 20px !important;
214
  }
215
 
216
- /* Fix message styling */
217
  .gradio-chatbot .message.bot .markdown {
218
  background-color: rgb(240, 185, 103) !important;
219
  color: black !important;
@@ -250,30 +235,6 @@ html, body {
250
  background-color: rgb(240, 236, 230);
251
  border-top: 2px solid rgba(28, 18, 5, 0.1);
252
  padding: 20px;
253
- min-height: 80px;
254
- }
255
-
256
- /* Input textbox styling */
257
- .input-section .gradio-textbox {
258
- background-color: rgb(242, 238, 233) !important;
259
- border: 2px solid rgb(28, 18, 5) !important;
260
- border-radius: 20px !important;
261
- margin-bottom: 10px !important;
262
- }
263
-
264
- .input-section .gradio-textbox textarea {
265
- background-color: transparent !important;
266
- border: none !important;
267
- color: black !important;
268
- padding: 15px !important;
269
- font-size: 16px !important;
270
- min-height: 50px !important;
271
- resize: vertical !important;
272
- }
273
-
274
- .input-section .gradio-textbox textarea:focus {
275
- outline: none !important;
276
- box-shadow: none !important;
277
  }
278
 
279
  /* Clear button styling */
@@ -284,23 +245,26 @@ html, body {
284
  border-radius: 10px !important;
285
  padding: 8px 16px !important;
286
  cursor: pointer !important;
287
- float: right;
288
  }
289
 
290
  .clear-button:hover {
291
  background-color: rgba(28, 18, 5, 0.8) !important;
292
  }
293
 
294
- /* Remove default margins and padding that might interfere */
295
- .gradio-container .block {
296
- margin: 0 !important;
297
- padding: 0 !important;
298
- border: none !important;
299
  }
300
 
301
- /* Ensure proper scrolling */
302
- .gradio-chatbot {
303
- overflow-y: auto !important;
 
 
 
304
  }
305
  """
306
 
@@ -309,26 +273,25 @@ with gr.Blocks(css=custom_css, title="EduBot") as demo:
309
  # Title Section
310
  gr.HTML('<div class="title-header"><h1>🎓 EduBot</h1></div>')
311
 
312
- # Chat Section - with explicit height
313
  with gr.Row(elem_classes=["chat-container"]):
314
  chatbot = gr.Chatbot(
315
  type="messages",
316
  show_copy_button=True,
317
  show_share_button=False,
318
  avatar_images=None,
319
- height="100%"
320
  )
321
 
322
  # Input Section
323
  with gr.Column(elem_classes=["input-section"]):
324
- with gr.Row():
325
- clear = gr.Button("Clear", elem_classes=["clear-button"])
326
  msg = gr.Textbox(
327
  placeholder="Ask me about math, research, study strategies, or any educational topic...",
328
  show_label=False,
329
- lines=2,
330
- max_lines=6,
331
- interactive=True
332
  )
333
 
334
  def respond_and_update(message, history):
 
164
 
165
  # --- Fixed Gradio UI and CSS ---
166
  custom_css = """
 
 
 
 
 
 
 
167
  /* Main container styling */
168
  .gradio-container {
169
  background-color: rgb(240, 236, 230) !important;
170
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
 
 
 
 
171
  }
172
 
173
  /* Title styling */
 
185
  margin: 0;
186
  }
187
 
188
+ /* Chat container */
189
  .chat-container {
190
+ min-height: 500px;
 
191
  background-color: rgb(240, 236, 230);
192
  }
193
 
194
+ /* Chatbot styling */
195
+ .gradio-chatbot {
 
 
 
196
  background-color: transparent !important;
197
  border: none !important;
198
  padding: 20px !important;
199
  }
200
 
201
+ /* Message styling */
202
  .gradio-chatbot .message.bot .markdown {
203
  background-color: rgb(240, 185, 103) !important;
204
  color: black !important;
 
235
  background-color: rgb(240, 236, 230);
236
  border-top: 2px solid rgba(28, 18, 5, 0.1);
237
  padding: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
239
 
240
  /* Clear button styling */
 
245
  border-radius: 10px !important;
246
  padding: 8px 16px !important;
247
  cursor: pointer !important;
248
+ margin-bottom: 10px !important;
249
  }
250
 
251
  .clear-button:hover {
252
  background-color: rgba(28, 18, 5, 0.8) !important;
253
  }
254
 
255
+ /* Textbox styling */
256
+ .input-textbox {
257
+ background-color: rgb(242, 238, 233) !important;
258
+ border: 2px solid rgb(28, 18, 5) !important;
259
+ border-radius: 20px !important;
260
  }
261
 
262
+ .input-textbox textarea {
263
+ background-color: transparent !important;
264
+ border: none !important;
265
+ color: black !important;
266
+ padding: 15px !important;
267
+ font-size: 16px !important;
268
  }
269
  """
270
 
 
273
  # Title Section
274
  gr.HTML('<div class="title-header"><h1>🎓 EduBot</h1></div>')
275
 
276
+ # Chat Section
277
  with gr.Row(elem_classes=["chat-container"]):
278
  chatbot = gr.Chatbot(
279
  type="messages",
280
  show_copy_button=True,
281
  show_share_button=False,
282
  avatar_images=None,
283
+ height=500
284
  )
285
 
286
  # Input Section
287
  with gr.Column(elem_classes=["input-section"]):
288
+ clear = gr.Button("Clear", elem_classes=["clear-button"])
 
289
  msg = gr.Textbox(
290
  placeholder="Ask me about math, research, study strategies, or any educational topic...",
291
  show_label=False,
292
+ lines=3,
293
+ max_lines=8,
294
+ elem_classes=["input-textbox"]
295
  )
296
 
297
  def respond_and_update(message, history):