GogetaBlueMUI commited on
Commit
0b5198b
·
verified ·
1 Parent(s): 0774345

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -12
app.py CHANGED
@@ -12,7 +12,7 @@ import psutil
12
 
13
  st.set_page_config(layout="wide")
14
 
15
- # CSS with added styling for checkbox visibility
16
  st.markdown("""
17
  <style>
18
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
@@ -204,17 +204,23 @@ input[type="file"]:hover {
204
  }
205
 
206
  /* Checkbox Styling */
207
- .stCheckbox {
208
- margin: 1rem 0;
209
- padding: 0.5rem;
210
- background-color: #f8f9fa;
211
- border-radius: 0.5rem;
212
- border: 1px solid #2196f3;
 
213
  }
214
- .stCheckbox label {
215
- font-size: 1.1rem;
216
- font-weight: 500;
217
- color: #1a1a1a;
 
 
 
 
 
218
  }
219
 
220
  /* Footer */
@@ -543,15 +549,21 @@ def main():
543
  language_code = "en" if language == "English" else "ur"
544
  st.session_state['language'] = language
545
  st.session_state['language_code'] = language_code
 
546
  chunk_duration = st.number_input("Duration per chunk (seconds):", min_value=1.0, step=0.1, value=10.0)
547
  if language_code == "ur":
548
  st.markdown("### Translation Option")
549
- with st.container():
 
550
  st.write("Debug: Rendering English translation checkbox for Urdu video.")
551
  translate_to_english = st.checkbox("Generate English translation", key="translate_checkbox")
552
  st.session_state['translate_to_english'] = translate_to_english
 
 
 
553
  else:
554
  st.session_state['translate_to_english'] = False
 
555
  if st.form_submit_button("Process"):
556
  with st.spinner("Processing video..."):
557
  start_time = time.time()
 
12
 
13
  st.set_page_config(layout="wide")
14
 
15
+ # CSS with enhanced checkbox styling
16
  st.markdown("""
17
  <style>
18
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
 
204
  }
205
 
206
  /* Checkbox Styling */
207
+ div[data-testid="stCheckbox"] {
208
+ margin: 1rem 0 !important;
209
+ padding: 0.5rem !important;
210
+ background-color: #f8f9fa !important;
211
+ border-radius: 0.5rem !important;
212
+ border: 2px solid #2196f3 !important;
213
+ z-index: 10 !important;
214
  }
215
+ div[data-testid="stCheckbox"] label {
216
+ font-size: 1.2rem !important;
217
+ font-weight: 600 !important;
218
+ color: #1a1a1a !important;
219
+ display: block !important;
220
+ }
221
+ div[data-testid="stCheckbox"] input {
222
+ transform: scale(1.5) !important;
223
+ margin-right: 0.5rem !important;
224
  }
225
 
226
  /* Footer */
 
549
  language_code = "en" if language == "English" else "ur"
550
  st.session_state['language'] = language
551
  st.session_state['language_code'] = language_code
552
+ st.write(f"Debug: Language selected: {language} (Code: {language_code})")
553
  chunk_duration = st.number_input("Duration per chunk (seconds):", min_value=1.0, step=0.1, value=10.0)
554
  if language_code == "ur":
555
  st.markdown("### Translation Option")
556
+ col1, col2 = st.columns([1, 3])
557
+ with col1:
558
  st.write("Debug: Rendering English translation checkbox for Urdu video.")
559
  translate_to_english = st.checkbox("Generate English translation", key="translate_checkbox")
560
  st.session_state['translate_to_english'] = translate_to_english
561
+ st.write(f"Debug: Translate to English set to: {st.session_state['translate_to_english']}")
562
+ with col2:
563
+ st.empty() # Placeholder for spacing
564
  else:
565
  st.session_state['translate_to_english'] = False
566
+ st.write("Debug: English selected, no translation checkbox displayed.")
567
  if st.form_submit_button("Process"):
568
  with st.spinner("Processing video..."):
569
  start_time = time.time()