JeCabrera commited on
Commit
df91b44
·
verified ·
1 Parent(s): d15a6cf

Upload 12 files

Browse files
Files changed (2) hide show
  1. app.py +45 -28
  2. formulas/__init__.py +4 -1
app.py CHANGED
@@ -5,7 +5,6 @@ import google.generativeai as genai
5
  import random
6
  import datetime
7
  from streamlit import session_state as state
8
- from angles import angles
9
  from formulas.webinar_formulas import webinar_formulas
10
  from formulas.webinar_name_formulas import webinar_name_formulas
11
  from formulas.angles_webinar_names import angles_webinar_names
@@ -353,36 +352,54 @@ def load_css():
353
  st.warning(f"No se encontró el archivo CSS en {css_path}")
354
 
355
  # Create a reusable function for custom buttons
356
- def create_custom_button(label, button_key):
357
- # Create the hidden Streamlit button
358
- button_clicked = st.button(label, key=button_key)
359
-
360
- # Create the custom styled button that references the CSS classes
361
- st.markdown(
362
- f"""
363
  <style>
364
- div[data-testid="stButton"] > button[kind="primaryButton"] {{
365
- display: none;
366
- }}
367
- div.stButton > button:first-child {{
368
- display: none;
369
- }}
 
 
 
 
 
 
 
 
370
  </style>
371
- <div class="generate-webinar-button">
372
- <button
373
- type="button"
374
- onclick="document.querySelector('button[key=\"{button_key}\"]') ?
375
- document.querySelector('button[key=\"{button_key}\"]').click() :
376
- document.querySelector('button[data-testid=\"baseButton-primaryButton\"]').click()">
377
- {label}
378
- </button>
379
- </div>
380
- """,
381
- unsafe_allow_html=True
382
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
 
384
- # Return the button state
385
- return button_clicked
386
 
387
  # Modify the page config section to include the CSS loading
388
  st.set_page_config(page_title="Perfect Webinar Framework", layout="wide")
 
5
  import random
6
  import datetime
7
  from streamlit import session_state as state
 
8
  from formulas.webinar_formulas import webinar_formulas
9
  from formulas.webinar_name_formulas import webinar_name_formulas
10
  from formulas.angles_webinar_names import angles_webinar_names
 
352
  st.warning(f"No se encontró el archivo CSS en {css_path}")
353
 
354
  # Create a reusable function for custom buttons
355
+ # At the top of your file, define the styles dictionary
356
+ styles = {
357
+ "button": """
 
 
 
 
358
  <style>
359
+ div.stButton > button:first-child {
360
+ background-color: #FF4B4B;
361
+ color: white;
362
+ font-weight: bold;
363
+ padding: 0.5rem 1rem;
364
+ border-radius: 0.5rem;
365
+ border: none;
366
+ transition: all 0.3s;
367
+ }
368
+ div.stButton > button:hover {
369
+ background-color: #FF2525;
370
+ transform: translateY(-2px);
371
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
372
+ }
373
  </style>
374
+ """,
375
+ "download_button": """
376
+ <style>
377
+ div.stDownloadButton > button:first-child {
378
+ background-color: #4CAF50;
379
+ color: white;
380
+ font-weight: bold;
381
+ padding: 0.5rem 1rem;
382
+ border-radius: 0.5rem;
383
+ border: none;
384
+ transition: all 0.3s;
385
+ }
386
+ div.stDownloadButton > button:hover {
387
+ background-color: #45a049;
388
+ transform: translateY(-2px);
389
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
390
+ }
391
+ </style>
392
+ """
393
+ }
394
+
395
+ # Then modify your create_custom_button function to be much simpler:
396
+ def create_custom_button(label, button_key):
397
+ # Apply the button style once at the beginning of your app
398
+ # (You can move this to your main app code if you prefer)
399
+ st.markdown(styles["button"], unsafe_allow_html=True)
400
 
401
+ # Just return a regular Streamlit button
402
+ return st.button(label, key=button_key)
403
 
404
  # Modify the page config section to include the CSS loading
405
  st.set_page_config(page_title="Perfect Webinar Framework", layout="wide")
formulas/__init__.py CHANGED
@@ -1 +1,4 @@
1
- from .headline_formulas import headline_formulas
 
 
 
 
1
+ from .headline_formulas import headline_formulas
2
+ from .webinar_formulas import webinar_formulas
3
+ from .webinar_name_formulas import webinar_name_formulas
4
+ from .angles_webinar_names import angles_webinar_names