Wanswan commited on
Commit
3f3f880
·
verified ·
1 Parent(s): 406454e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -4
app.py CHANGED
@@ -212,10 +212,10 @@ with gr.Blocks(css="""
212
  cursor: pointer;
213
  }
214
  #chatbox .avatar-container {
215
- width: 64px !important;
216
- height: 64px !important;
217
- min-width: 64px !important;
218
- min-height: 64px !important;
219
  background-size: 100% 100% !important;
220
  background-position: center center !important;
221
  border-radius: 50% !important;
@@ -226,6 +226,27 @@ with gr.Blocks(css="""
226
  background-color: transparent !important;
227
  }
228
  #chatbox .message.user { background-color: #DCF8C6 !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  #chatbox .message.assistant { background-color: #ffffff !important; }
230
  footer { display: none !important; }
231
  .svelte-1ipelgc { display: none !important; }
@@ -253,6 +274,7 @@ label.svelte-1to105q {
253
  </script>
254
  """)
255
 
 
256
  chatbot = gr.Chatbot(
257
  elem_id="chatbox",
258
  label="",
 
212
  cursor: pointer;
213
  }
214
  #chatbox .avatar-container {
215
+ width: 54px !important;
216
+ height: 54px !important;
217
+ min-width: 54px !important;
218
+ min-height: 54px !important;
219
  background-size: 100% 100% !important;
220
  background-position: center center !important;
221
  border-radius: 50% !important;
 
226
  background-color: transparent !important;
227
  }
228
  #chatbox .message.user { background-color: #DCF8C6 !important; }
229
+ #chatbox .message {
230
+ display: inline-block !important;
231
+ font-size: 16px !important;
232
+ line-height: 1.3em !important;
233
+ min-width: 7ch !important;
234
+ max-width: 60ch !important;
235
+ padding: 2px 3px !important;
236
+ border-radius: 8px !important;
237
+ word-break: break-word !important;
238
+ white-space: normal !important;
239
+ }
240
+ @media screen and (max-width: 768px) {
241
+ #chatbox .message.user {
242
+ max-width: 90vw !important;
243
+ }
244
+ }
245
+ #chatbox .message.user {
246
+ background-color: #DCF8C6 !important;
247
+ min-width: 60px !important; /* ✅ 至少能装下一个短单词 */
248
+ max-width: fit-content !important; /* ✅ 自动根据内容长度调整宽度 */
249
+ }
250
  #chatbox .message.assistant { background-color: #ffffff !important; }
251
  footer { display: none !important; }
252
  .svelte-1ipelgc { display: none !important; }
 
274
  </script>
275
  """)
276
 
277
+
278
  chatbot = gr.Chatbot(
279
  elem_id="chatbox",
280
  label="",