rahul7star commited on
Commit
e137496
·
verified ·
1 Parent(s): 5600a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -90
app.py CHANGED
@@ -213,7 +213,10 @@ def build_ui():
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
- /* --- Hide Share & Delete Buttons --- */
 
 
 
217
  [data-testid="share-btn"],
218
  [data-testid="delete-btn"],
219
  .message-controls,
@@ -222,7 +225,7 @@ def build_ui():
222
  visibility: hidden !important;
223
  }
224
 
225
- /* --- User (Right Side) --- */
226
  #ohamlab .message.user {
227
  background-color: #4f46e5 !important;
228
  color: white !important;
@@ -230,11 +233,9 @@ def build_ui():
230
  align-self: flex-end !important;
231
  text-align: right !important;
232
  margin-left: 25%;
233
- padding: 0.6rem 1rem !important;
234
- max-width: 70%;
235
  }
236
 
237
- /* --- Bot (Left Side) --- */
238
  #ohamlab .message.assistant {
239
  background-color: #f8f9fa !important;
240
  color: #111 !important;
@@ -242,99 +243,47 @@ def build_ui():
242
  align-self: flex-start !important;
243
  text-align: left !important;
244
  margin-right: 25%;
245
- padding: 0.6rem 1rem !important;
246
- max-width: 70%;
247
- }
248
-
249
- /* --- Replace bot icon with 'OhamLab' label --- */
250
- #ohamlab .avatar span,
251
- #ohamlab .avatar {
252
- background: none !important;
253
- color: #4f46e5 !important;
254
- font-weight: 700 !important;
255
- font-size: 0.9rem !important;
256
- }
257
- #ohamlab .avatar::before {
258
- content: "OhamLab" !important;
259
- display: inline-block;
260
  }
261
 
 
 
 
 
 
 
262
  .gradio-container {
263
  max-width: 900px !important;
264
  margin: auto;
265
  padding-top: .5rem;
266
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  """,
268
- # css="""
269
- # /* --- Hide share/delete icons --- */
270
- # #ohamlab .wrap.svelte-1lcyrj3 > div > div > button {
271
- # display: none !important;
272
- # }
273
- # [data-testid="share-btn"],
274
- # [data-testid="delete-btn"],
275
- # .message-controls,
276
- # .message-actions {
277
- # display: none !important;
278
- # visibility: hidden !important;
279
- # }
280
-
281
- # /* --- User (Right) Message Bubble --- */
282
- # #ohamlab .message.user {
283
- # background-color: #4f46e5 !important;
284
- # color: white !important;
285
- # border-radius: 14px !important;
286
- # align-self: flex-end !important;
287
- # text-align: right !important;
288
- # margin-left: 25%;
289
- # }
290
-
291
- # /* --- OhamLab (Left) Message Bubble --- */
292
- # #ohamlab .message.assistant {
293
- # background-color: #f8f9fa !important;
294
- # color: #111 !important;
295
- # border-radius: 14px !important;
296
- # align-self: flex-start !important;
297
- # text-align: left !important;
298
- # margin-right: 25%;
299
- # }
300
- # #ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
301
- # display: none !important; /* hide share/delete icons */
302
- # }
303
-
304
- # /* --- Overall Container --- */
305
- # .gradio-container {
306
- # max-width: 900px !important;
307
- # margin: auto;
308
- # padding-top: .5rem;
309
- # }
310
- # textarea {
311
- # resize: none !important;
312
- # border-radius: 12px !important;
313
- # border: 1px solid #d1d5db !important;
314
- # box-shadow: 0 1px 3px rgba(0,0,0,0.08);
315
- # }
316
- # button.primary {
317
- # background-color: #4f46e5 !important;
318
- # color: white !important;
319
- # border-radius: 10px !important;
320
- # padding: 0.6rem 1.4rem !important;
321
- # font-weight: 600;
322
- # transition: all 0.2s ease-in-out;
323
- # }
324
- # button.primary:hover {
325
- # background-color: #4338ca !important;
326
- # }
327
- # button.secondary {
328
- # background-color: #f3f4f6 !important;
329
- # border-radius: 10px !important;
330
- # color: #374151 !important;
331
- # font-weight: 500;
332
- # transition: all 0.2s ease-in-out;
333
- # }
334
- # button.secondary:hover {
335
- # background-color: #e5e7eb !important;
336
- # }
337
- # """,
338
  ) as demo:
339
 
340
  # Chatbot area
 
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
+ /* --- Hide share/delete icons --- */
217
+ #ohamlab .wrap.svelte-1lcyrj3 > div > div > button {
218
+ display: none !important;
219
+ }
220
  [data-testid="share-btn"],
221
  [data-testid="delete-btn"],
222
  .message-controls,
 
225
  visibility: hidden !important;
226
  }
227
 
228
+ /* --- User (Right) Message Bubble --- */
229
  #ohamlab .message.user {
230
  background-color: #4f46e5 !important;
231
  color: white !important;
 
233
  align-self: flex-end !important;
234
  text-align: right !important;
235
  margin-left: 25%;
 
 
236
  }
237
 
238
+ /* --- OhamLab (Left) Message Bubble --- */
239
  #ohamlab .message.assistant {
240
  background-color: #f8f9fa !important;
241
  color: #111 !important;
 
243
  align-self: flex-start !important;
244
  text-align: left !important;
245
  margin-right: 25%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
 
248
+
249
+ #ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
250
+ display: none !important; /* hide share/delete icons */
251
+ }
252
+
253
+ /* --- Overall Container --- */
254
  .gradio-container {
255
  max-width: 900px !important;
256
  margin: auto;
257
  padding-top: .5rem;
258
  }
259
+ textarea {
260
+ resize: none !important;
261
+ border-radius: 12px !important;
262
+ border: 1px solid #d1d5db !important;
263
+ box-shadow: 0 1px 3px rgba(0,0,0,0.08);
264
+ }
265
+ button.primary {
266
+ background-color: #4f46e5 !important;
267
+ color: white !important;
268
+ border-radius: 10px !important;
269
+ padding: 0.6rem 1.4rem !important;
270
+ font-weight: 600;
271
+ transition: all 0.2s ease-in-out;
272
+ }
273
+ button.primary:hover {
274
+ background-color: #4338ca !important;
275
+ }
276
+ button.secondary {
277
+ background-color: #f3f4f6 !important;
278
+ border-radius: 10px !important;
279
+ color: #374151 !important;
280
+ font-weight: 500;
281
+ transition: all 0.2s ease-in-out;
282
+ }
283
+ button.secondary:hover {
284
+ background-color: #e5e7eb !important;
285
+ }
286
  """,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  ) as demo:
288
 
289
  # Chatbot area