BICORP commited on
Commit
4b672ce
·
verified ·
1 Parent(s): 42dd7fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -9
app.py CHANGED
@@ -26,24 +26,42 @@ def create_chat_interface():
26
  chatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)
27
 
28
  with gr.Row():
29
- # Textbox for user input
30
- with gr.Column(scale=0.9):
31
- user_input = gr.Textbox(placeholder="Type your message here...", label="Your Input", lines=1)
32
- # Square send button
33
- with gr.Column(scale=0.1):
34
  send_button = gr.Button("📤", elem_id="send_button")
35
 
36
- # Add CSS to style the send button as a square
37
  demo.css = """
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  #send_button {
39
  width: 40px;
40
  height: 40px;
41
- padding: 0;
42
- margin: 0;
 
 
43
  display: flex;
44
  justify-content: center;
45
  align-items: center;
46
- border-radius: 5px; /* Optional: For slightly rounded corners */
 
 
 
47
  }
48
  """
49
 
 
26
  chatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)
27
 
28
  with gr.Row():
29
+ # Container for input and send button
30
+ with gr.Box(elem_id="input_container"):
31
+ user_input = gr.Textbox(
32
+ placeholder="Type your message here...", label=None, lines=1, elem_id="user_input"
33
+ )
34
  send_button = gr.Button("📤", elem_id="send_button")
35
 
36
+ # Add CSS for styling the input container and placing the button inside
37
  demo.css = """
38
+ #input_container {
39
+ display: flex;
40
+ align-items: center;
41
+ border: 1px solid #ccc;
42
+ border-radius: 8px;
43
+ padding: 5px;
44
+ }
45
+ #user_input {
46
+ flex-grow: 1;
47
+ border: none;
48
+ outline: none;
49
+ padding: 8px;
50
+ }
51
  #send_button {
52
  width: 40px;
53
  height: 40px;
54
+ background-color: #007bff;
55
+ color: white;
56
+ border: none;
57
+ border-radius: 50%;
58
  display: flex;
59
  justify-content: center;
60
  align-items: center;
61
+ cursor: pointer;
62
+ }
63
+ #send_button:hover {
64
+ background-color: #0056b3;
65
  }
66
  """
67