YanTianlong commited on
Commit
98f4ce5
·
1 Parent(s): f0be85a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -13
app.py CHANGED
@@ -88,8 +88,8 @@ APP_CSS = """
88
  --vg-muted: #667085;
89
  --vg-line: #eceef5;
90
  --vg-soft: #f6f7fb;
91
- --vg-radius: 10px;
92
- --vg-radius-sm: 10px;
93
  }
94
  :root:root:root:root main {
95
  max-width: 1160px;
@@ -261,16 +261,51 @@ APP_CSS = """
261
  border-radius: var(--vg-radius-sm) !important;
262
  }
263
 
264
- /* Make accordions look like simple rows instead of another nested card. */
265
- .voicegate-card details,
266
- .voicegate-card details > summary {
267
- border: 0 !important;
 
 
 
 
 
 
 
 
 
 
 
 
268
  box-shadow: none !important;
269
- background: transparent !important;
270
  }
271
- .voicegate-card details > summary {
272
- padding-left: 0 !important;
273
- padding-right: 0 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  }
275
 
276
  /* Full-width primary action without an extra gr.Group wrapper. */
@@ -1119,7 +1154,7 @@ with gr.Blocks(title="VoiceGate", fill_width=True) as demo:
1119
  value="English",
1120
  elem_classes=["voicegate-control-card"],
1121
  )
1122
- with gr.Accordion("Advanced audio cleanup", open=False):
1123
  user_tts_trim_start = gr.Slider(
1124
  label="TTS segment trim start",
1125
  minimum=0.0,
@@ -1143,12 +1178,12 @@ with gr.Blocks(title="VoiceGate", fill_width=True) as demo:
1143
  with gr.Row(elem_classes=["voicegate-downloads"]):
1144
  user_source_file = gr.DownloadButton("Download original subtitles", size="sm")
1145
  user_translated_file = gr.DownloadButton("Download translated subtitles", size="sm")
1146
- with gr.Accordion("Subtitle preview", open=True):
1147
  with gr.Row():
1148
  user_source_text = gr.Textbox(label="Original subtitles", lines=8)
1149
  user_translated_text = gr.Textbox(label="Translated subtitles", lines=8)
1150
  with gr.Blocks(elem_classes=["voicegate-card"]):
1151
- with gr.Accordion("Log", open=True):
1152
  user_status = gr.Textbox(label="Status", lines=12, elem_classes=["voicegate-status"])
1153
  user_run.click(
1154
  fn=voicegate_user_run,
 
88
  --vg-muted: #667085;
89
  --vg-line: #eceef5;
90
  --vg-soft: #f6f7fb;
91
+ --vg-radius: 8px;
92
+ --vg-radius-sm: 6px;
93
  }
94
  :root:root:root:root main {
95
  max-width: 1160px;
 
261
  border-radius: var(--vg-radius-sm) !important;
262
  }
263
 
264
+ /* Rounded accordion cards: Advanced audio cleanup, Subtitle preview, and Log.
265
+ Keep them visually light, but give the expanded sections the same soft radius as
266
+ Upload audio and Target language. */
267
+ .voicegate-accordion-card,
268
+ .voicegate-accordion-card.block,
269
+ .voicegate-accordion-card > .block,
270
+ .voicegate-accordion-card > div,
271
+ .voicegate-accordion-card > div > .block,
272
+ .voicegate-accordion-card details {
273
+ border-radius: var(--vg-radius) !important;
274
+ overflow: hidden !important;
275
+ }
276
+
277
+ .voicegate-accordion-card details {
278
+ border: 1px solid var(--vg-line) !important;
279
+ background: #ffffff !important;
280
  box-shadow: none !important;
 
281
  }
282
+
283
+ .voicegate-accordion-card details > summary {
284
+ border-radius: var(--vg-radius) var(--vg-radius) 0 0 !important;
285
+ padding: 10px 12px !important;
286
+ background: var(--vg-soft) !important;
287
+ box-shadow: none !important;
288
+ }
289
+
290
+ .voicegate-accordion-card details:not([open]) > summary {
291
+ border-radius: var(--vg-radius) !important;
292
+ }
293
+
294
+ .voicegate-accordion-card details[open] > summary {
295
+ border-bottom: 1px solid var(--vg-line) !important;
296
+ }
297
+
298
+ /* The content rendered inside an open accordion can have its own Gradio wrappers.
299
+ Round those wrappers too so textboxes/sliders do not look square inside. */
300
+ .voicegate-accordion-card .block,
301
+ .voicegate-accordion-card .form,
302
+ .voicegate-accordion-card .wrap,
303
+ .voicegate-accordion-card .container,
304
+ .voicegate-accordion-card .input-container,
305
+ .voicegate-accordion-card textarea,
306
+ .voicegate-accordion-card input,
307
+ .voicegate-accordion-card select {
308
+ border-radius: var(--vg-radius-sm) !important;
309
  }
310
 
311
  /* Full-width primary action without an extra gr.Group wrapper. */
 
1154
  value="English",
1155
  elem_classes=["voicegate-control-card"],
1156
  )
1157
+ with gr.Accordion("Advanced audio cleanup", open=False, elem_classes=["voicegate-accordion-card"]):
1158
  user_tts_trim_start = gr.Slider(
1159
  label="TTS segment trim start",
1160
  minimum=0.0,
 
1178
  with gr.Row(elem_classes=["voicegate-downloads"]):
1179
  user_source_file = gr.DownloadButton("Download original subtitles", size="sm")
1180
  user_translated_file = gr.DownloadButton("Download translated subtitles", size="sm")
1181
+ with gr.Accordion("Subtitle preview", open=True, elem_classes=["voicegate-accordion-card"]):
1182
  with gr.Row():
1183
  user_source_text = gr.Textbox(label="Original subtitles", lines=8)
1184
  user_translated_text = gr.Textbox(label="Translated subtitles", lines=8)
1185
  with gr.Blocks(elem_classes=["voicegate-card"]):
1186
+ with gr.Accordion("Log", open=True, elem_classes=["voicegate-accordion-card"]):
1187
  user_status = gr.Textbox(label="Status", lines=12, elem_classes=["voicegate-status"])
1188
  user_run.click(
1189
  fn=voicegate_user_run,