shukdevdatta123 commited on
Commit
5c92c98
·
verified ·
1 Parent(s): 477f138

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -16
app.py CHANGED
@@ -62,7 +62,7 @@ def chatbot(input_text, image, openai_api_key, reasoning_effort, model_choice, h
62
  def clear_history():
63
  return "", []
64
 
65
- # Custom CSS styles with animations
66
  custom_css = """
67
  /* General body styles */
68
  .gradio-container {
@@ -111,8 +111,9 @@ custom_css = """
111
  border-color: #007bff;
112
  }
113
  /* Button styles */
114
- .gradio-button {
115
- background-color: #007bff;
 
116
  color: white;
117
  border: none;
118
  border-radius: 8px;
@@ -121,12 +122,31 @@ custom_css = """
121
  cursor: pointer;
122
  transition: all 0.3s ease;
123
  }
124
- .gradio-button:hover {
125
- background-color: #0056b3;
126
  }
127
- .gradio-button:active {
128
  transform: scale(0.95);
129
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  /* Chat history styles */
131
  .gradio-chatbot .message {
132
  margin-bottom: 10px;
@@ -148,14 +168,7 @@ custom_css = """
148
  margin-left: auto;
149
  animation: slideInAssistant 0.5s ease-out;
150
  }
151
- /* Clear button style */
152
- .gradio-button.clear-history {
153
- background-color: #dc3545;
154
- margin-left: 10px;
155
- }
156
- .gradio-button.clear-history:hover {
157
- background-color: #c82333;
158
- }
159
  /* Animation keyframes */
160
  @keyframes fadeIn {
161
  0% { opacity: 0; }
@@ -216,8 +229,8 @@ def create_interface():
216
  choices=["o1", "o3-mini"],
217
  value="o1" # Default to 'o1' for image-related tasks
218
  )
219
- submit_btn = gr.Button("Send")
220
- clear_btn = gr.Button("Clear History") # No class_name argument
221
 
222
  chat_history = gr.Chatbot()
223
 
 
62
  def clear_history():
63
  return "", []
64
 
65
+ # Custom CSS styles with animations and button colors
66
  custom_css = """
67
  /* General body styles */
68
  .gradio-container {
 
111
  border-color: #007bff;
112
  }
113
  /* Button styles */
114
+ /* Send Button: Sky Blue */
115
+ #submit-btn {
116
+ background-color: #00aaff; /* Sky blue */
117
  color: white;
118
  border: none;
119
  border-radius: 8px;
 
122
  cursor: pointer;
123
  transition: all 0.3s ease;
124
  }
125
+ #submit-btn:hover {
126
+ background-color: #0099cc; /* Slightly darker blue */
127
  }
128
+ #submit-btn:active {
129
  transform: scale(0.95);
130
  }
131
+
132
+ /* Clear History Button: Light Red */
133
+ #clear-history {
134
+ background-color: #f5a4a4; /* Light red */
135
+ color: white;
136
+ border: none;
137
+ border-radius: 8px;
138
+ padding: 12px 20px;
139
+ font-size: 1.1rem;
140
+ cursor: pointer;
141
+ transition: all 0.3s ease;
142
+ }
143
+ #clear-history:hover {
144
+ background-color: #f04e4e; /* Slightly darker red */
145
+ }
146
+ #clear-history:active {
147
+ transform: scale(0.95);
148
+ }
149
+
150
  /* Chat history styles */
151
  .gradio-chatbot .message {
152
  margin-bottom: 10px;
 
168
  margin-left: auto;
169
  animation: slideInAssistant 0.5s ease-out;
170
  }
171
+
 
 
 
 
 
 
 
172
  /* Animation keyframes */
173
  @keyframes fadeIn {
174
  0% { opacity: 0; }
 
229
  choices=["o1", "o3-mini"],
230
  value="o1" # Default to 'o1' for image-related tasks
231
  )
232
+ submit_btn = gr.Button("Send", elem_id="submit-btn")
233
+ clear_btn = gr.Button("Clear History", elem_id="clear-history")
234
 
235
  chat_history = gr.Chatbot()
236