Marek4321 commited on
Commit
55528e9
·
verified ·
1 Parent(s): 45b638c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -4
app.py CHANGED
@@ -200,14 +200,36 @@ class TranslatorApp:
200
  finally:
201
  self.processing = False
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  def create_interface():
204
  app = TranslatorApp()
205
- with gr.Blocks() as interface:
206
  gr.Markdown("# BabelSlide by Heuristica")
207
  gr.Markdown("Translate PowerPoint presentations using various AI models.")
208
 
209
  with gr.Row():
210
- file_input = gr.File(label="Upload PowerPoint File")
211
  api_provider = gr.Dropdown(label="API Provider", choices=list(API_PROVIDERS.keys()))
212
  api_key = gr.Textbox(label="API Key", type="password")
213
  source_lang = gr.Dropdown(label="Source Language", choices=list(LANGUAGES.keys()))
@@ -215,8 +237,8 @@ def create_interface():
215
 
216
  progress_bar = gr.Progress()
217
  output_text = gr.Textbox(label="Output", interactive=False)
218
- output_file = gr.File(label="Download Translated PowerPoint")
219
- output_review = gr.File(label="Download Review")
220
 
221
  run_button = gr.Button("Translate")
222
  run_button.click(
 
200
  finally:
201
  self.processing = False
202
 
203
+ # Custom CSS for styling
204
+ custom_css = """
205
+ /* Style for the Translate button */
206
+ button {
207
+ background-color: orange !important;
208
+ color: white !important;
209
+ border: none !important;
210
+ }
211
+
212
+ /* Style for the Upload PowerPoint file input */
213
+ .upload-area {
214
+ border: 2px solid orange !important;
215
+ padding: 10px !important;
216
+ border-radius: 5px !important;
217
+ }
218
+
219
+ /* Adjust height of download file components */
220
+ .download-box {
221
+ height: 50px !important;
222
+ }
223
+ """
224
+
225
  def create_interface():
226
  app = TranslatorApp()
227
+ with gr.Blocks(css=custom_css) as interface:
228
  gr.Markdown("# BabelSlide by Heuristica")
229
  gr.Markdown("Translate PowerPoint presentations using various AI models.")
230
 
231
  with gr.Row():
232
+ file_input = gr.File(label="Upload PowerPoint File", elem_classes="upload-area")
233
  api_provider = gr.Dropdown(label="API Provider", choices=list(API_PROVIDERS.keys()))
234
  api_key = gr.Textbox(label="API Key", type="password")
235
  source_lang = gr.Dropdown(label="Source Language", choices=list(LANGUAGES.keys()))
 
237
 
238
  progress_bar = gr.Progress()
239
  output_text = gr.Textbox(label="Output", interactive=False)
240
+ output_file = gr.File(label="Download Translated PowerPoint", elem_classes="download-box")
241
+ output_review = gr.File(label="Download Review", elem_classes="download-box")
242
 
243
  run_button = gr.Button("Translate")
244
  run_button.click(