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

Textbox Adjustments

Browse files
Files changed (1) hide show
  1. app.py +18 -7
app.py CHANGED
@@ -237,22 +237,30 @@ custom_css = """
237
  padding: 20px;
238
  }
239
 
240
- /* Clear button styling */
241
- .clear-button {
242
  background-color: rgb(28, 18, 5) !important;
243
  color: white !important;
244
  border: none !important;
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;
@@ -285,7 +293,9 @@ with gr.Blocks(css=custom_css, title="EduBot") as demo:
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,
@@ -319,8 +329,9 @@ with gr.Blocks(css=custom_css, title="EduBot") as demo:
319
  """Clear the chat history."""
320
  return [], ""
321
 
322
- # Set up the "send on Enter" event
323
  msg.submit(respond_and_update, [msg, chatbot], [chatbot, msg])
 
324
 
325
  # Set up the clear button
326
  clear.click(clear_chat, outputs=[chatbot, msg])
 
237
  padding: 20px;
238
  }
239
 
240
+ /* Button styling */
241
+ .clear-button, .send-button {
242
  background-color: rgb(28, 18, 5) !important;
243
  color: white !important;
244
  border: none !important;
245
  border-radius: 10px !important;
246
  padding: 8px 16px !important;
247
  cursor: pointer !important;
248
+ margin: 5px !important;
249
  }
250
 
251
+ .clear-button:hover, .send-button:hover {
252
  background-color: rgba(28, 18, 5, 0.8) !important;
253
  }
254
 
255
+ .send-button {
256
+ background-color: rgb(51, 102, 204) !important;
257
+ }
258
+
259
+ .send-button:hover {
260
+ background-color: rgba(51, 102, 204, 0.8) !important;
261
+ }
262
+
263
+ /* Textbox styling - keep it simple */
264
  .input-textbox {
265
  background-color: rgb(242, 238, 233) !important;
266
  border: 2px solid rgb(28, 18, 5) !important;
 
293
 
294
  # Input Section
295
  with gr.Column(elem_classes=["input-section"]):
296
+ with gr.Row():
297
+ clear = gr.Button("Clear", elem_classes=["clear-button"])
298
+ send = gr.Button("Send", elem_classes=["send-button"])
299
  msg = gr.Textbox(
300
  placeholder="Ask me about math, research, study strategies, or any educational topic...",
301
  show_label=False,
 
329
  """Clear the chat history."""
330
  return [], ""
331
 
332
+ # Set up the "send on Enter" event and send button click
333
  msg.submit(respond_and_update, [msg, chatbot], [chatbot, msg])
334
+ send.click(respond_and_update, [msg, chatbot], [chatbot, msg])
335
 
336
  # Set up the clear button
337
  clear.click(clear_chat, outputs=[chatbot, msg])