Wanswan commited on
Commit
3e1210d
·
verified ·
1 Parent(s): 9d2bd3c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -55
app.py CHANGED
@@ -199,6 +199,7 @@ async def respond(user_input, history, step, language, questions, followup_mode)
199
  def init():
200
  return [{"role": "assistant", "content": WELCOME_MESSAGE_EN}], 0, "", [], False
201
 
 
202
  with gr.Blocks(css="""
203
  .send-btn {
204
  background-color: #25D366 !important;
@@ -211,78 +212,44 @@ with gr.Blocks(css="""
211
  width: 60px;
212
  margin-left: 8px;
213
  cursor: pointer;
214
- flex-shrink: 0 !important;
215
  }
216
-
217
  #chatbox .avatar-container {
218
- width: 64px !important;
219
- height: 64px !important;
220
- min-width: 64px !important;
221
- min-height: 64px !important;
222
- background-size: 100% 100% !important;
223
- background-position: center center !important;
224
- border-radius: 50% !important;
225
- padding: 0 !important;
226
- margin: 0 !important;
227
- border: none !important;
228
- box-shadow: none !important;
229
- background-co的程度: transparent !important;
230
  }
231
-
232
  #chatbox .message.user { background-color: #DCF8C6 !important; }
233
- #chatbox .message.assistant { background-color: #ffffff !important; }
234
-
235
- footer, .svelte-1ipelgc, .icon-button-wrapper, label.svelte-1to105q {
236
- display: none !important;
237
- }
238
-
239
- /* ✅ 解锁 Gradio 聊天气泡在 iframe / mobile 下的最大可用宽度 */
240
- html, body, .gradio-container, #root, .main, .wrap, .prose, .gr-box {
241
- max-width: 100% !important;
242
- width: 100% !important;
243
- margin: 0 auto !important;
244
- padding: 0 !important;
245
- box-sizing: border-box !important;
246
- overflow-x: hidden !important;
247
- }
248
-
249
- /* ✅ 聊天气泡最大宽度和排版优化 */
250
  #chatbox .message {
251
  display: inline-block !important;
252
  font-size: 16px !important;
253
  line-height: 1.6em !important;
254
  min-width: 10ch !important;
255
- max-width: 90% !important;
256
- padding: 6px 12px !important;
257
  border-radius: 12px !important;
258
  word-break: break-word !important;
259
  word-wrap: break-word !important;
260
  white-space: normal !important;
261
  }
262
 
263
-
264
- @media screen and (max-width: 768px) {
265
- #chatbox .message {
266
- font-size: 15px !important;
267
- max-width: 94vw !important;
268
- }
269
- }
270
-
271
- body {
272
- background-color: #f9f9f9 !important;
273
- width: 100vw !important;
274
- min-width: 100vw !important;
275
- overflow-x: hidden !important;
276
  }
277
-
278
- .prose, .main, .container, .max-w-4xl {
279
- max-width: 100vw !important;
280
- width: 100vw !important;
281
- margin: 0 !important;
282
- padding: 0 !important;
283
  }
284
  """) as demo:
285
-
286
  gr.HTML("""
287
  <script>
288
  const waitForChatbox = () => {
@@ -331,4 +298,4 @@ body {
331
  send_btn.click(respond, [user_input, state, step, language, questions, followup_mode],
332
  [chatbot, user_input, step, language, questions, followup_mode])
333
 
334
- demo.queue().launch()
 
199
  def init():
200
  return [{"role": "assistant", "content": WELCOME_MESSAGE_EN}], 0, "", [], False
201
 
202
+
203
  with gr.Blocks(css="""
204
  .send-btn {
205
  background-color: #25D366 !important;
 
212
  width: 60px;
213
  margin-left: 8px;
214
  cursor: pointer;
 
215
  }
 
216
  #chatbox .avatar-container {
217
+ width: 48px !important;
218
+ height: 48px !important;
219
+ min-width: 48px !important;
220
+ min-height: 48px !important;
221
+ background-size: 100% 100% !important;
222
+ background-position: center center !important;
223
+ border-radius: 50% !important;
224
+ padding: 0 !important;
225
+ margin: 0 !important;
226
+ border: none !important;
227
+ box-shadow: none !important;
228
+ background-color: transparent !important;
229
  }
 
230
  #chatbox .message.user { background-color: #DCF8C6 !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  #chatbox .message {
232
  display: inline-block !important;
233
  font-size: 16px !important;
234
  line-height: 1.6em !important;
235
  min-width: 10ch !important;
236
+ max-width: 96% !important;
 
237
  border-radius: 12px !important;
238
  word-break: break-word !important;
239
  word-wrap: break-word !important;
240
  white-space: normal !important;
241
  }
242
 
243
+ #chatbox .message.assistant { background-color: #ffffff !important; }
244
+ footer { display: none !important; }
245
+ .svelte-1ipelgc { display: none !important; }
246
+ .icon-button-wrapper {
247
+ display: none !important;
 
 
 
 
 
 
 
 
248
  }
249
+ label.svelte-1to105q {
250
+ display: none !important;
 
 
 
 
251
  }
252
  """) as demo:
 
253
  gr.HTML("""
254
  <script>
255
  const waitForChatbox = () => {
 
298
  send_btn.click(respond, [user_input, state, step, language, questions, followup_mode],
299
  [chatbot, user_input, step, language, questions, followup_mode])
300
 
301
+ demo.queue().launch()