atnikos commited on
Commit
1277b3a
·
1 Parent(s): 8d1378a

fixes for examples

Browse files
Files changed (2) hide show
  1. app.py +13 -5
  2. style.css +1 -0
app.py CHANGED
@@ -296,15 +296,15 @@ def create_gradio_interface():
296
  height=180,width=240,
297
  label="Example 1")
298
  example_button1 = gr.Button("Select Example 1",
299
- size='sm')
300
 
301
  # Second example
302
- with gr.Column(scale=2):
303
  gr.Video(value=example_videos[1],
304
  height=180,width=240,
305
  label="Example 2")
306
  example_button2 = gr.Button("Select Example 2",
307
- size='sm',scale=1)
308
  with gr.Row():
309
 
310
  # Third example
@@ -313,7 +313,7 @@ def create_gradio_interface():
313
  height=180,width=240,
314
  label="Example 3")
315
  example_button3 = gr.Button("Select Example 3",
316
- size='sm')
317
 
318
  # Fourth example
319
  with gr.Column():
@@ -321,7 +321,7 @@ def create_gradio_interface():
321
  height=180,width=240,
322
  label="Example 4")
323
  example_button4 = gr.Button("Select Example 4",
324
- size='sm')
325
 
326
  with gr.Column(scale=5):
327
  gr.HTML(WEB_target)
@@ -429,6 +429,14 @@ CUSTOM_CSS = """
429
  .gradio-edit-row { gap: 10px; align-items: center; }
430
  .gradio-textbox-with-button { display: flex; align-items: center; }
431
  .gradio-textbox-with-button input { flex-grow: 1; }
 
 
 
 
 
 
 
 
432
  """
433
 
434
  if __name__ == "__main__":
 
296
  height=180,width=240,
297
  label="Example 1")
298
  example_button1 = gr.Button("Select Example 1",
299
+ size='sm', elem_classes=["fit-text"])
300
 
301
  # Second example
302
+ with gr.Column():
303
  gr.Video(value=example_videos[1],
304
  height=180,width=240,
305
  label="Example 2")
306
  example_button2 = gr.Button("Select Example 2",
307
+ elem_classes=["fit-text"])
308
  with gr.Row():
309
 
310
  # Third example
 
313
  height=180,width=240,
314
  label="Example 3")
315
  example_button3 = gr.Button("Select Example 3",
316
+ elem_classes=["fit-text"])
317
 
318
  # Fourth example
319
  with gr.Column():
 
321
  height=180,width=240,
322
  label="Example 4")
323
  example_button4 = gr.Button("Select Example 4",
324
+ elem_classes=["fit-text"])
325
 
326
  with gr.Column(scale=5):
327
  gr.HTML(WEB_target)
 
429
  .gradio-edit-row { gap: 10px; align-items: center; }
430
  .gradio-textbox-with-button { display: flex; align-items: center; }
431
  .gradio-textbox-with-button input { flex-grow: 1; }
432
+ button.fit-text {
433
+ width: auto; /* Automatically adjusts to the text length */
434
+ padding: 10px 20px; /* Adjust padding for a better look */
435
+ font-size: 14px; /* Control font size */
436
+ text-align: center; /* Center the text */
437
+ margin: 0 auto; /* Center the button horizontally */
438
+ display: inline-block; /* Prevent it from stretching */
439
+ }
440
  """
441
 
442
  if __name__ == "__main__":
style.css CHANGED
@@ -24,3 +24,4 @@
24
  gap: 10px;
25
  align-items: center;
26
  }
 
 
24
  gap: 10px;
25
  align-items: center;
26
  }
27
+