JeCabrera commited on
Commit
d769ab8
·
verified ·
1 Parent(s): b3d133b

Upload 19 files

Browse files
Files changed (1) hide show
  1. app.py +2 -14
app.py CHANGED
@@ -78,24 +78,11 @@ def generate_content(prompt, temperature=1.0):
78
 
79
  # Modify the display function to preserve content
80
  def display_generated_content(column, content, key_prefix):
81
- """Display generated content in the specified column with copy button."""
82
  if content:
83
  column.markdown("### Contenido generado:")
84
  column.markdown(content)
85
 
86
- # Add copy button
87
- copy_button_key = f"{key_prefix}_copy_button"
88
- if column.button("Copiar al portapapeles", key=copy_button_key):
89
- # Use JavaScript to copy to clipboard
90
- content_escaped = content.replace("`", "\\`")
91
- js_code = f"""
92
- <script>
93
- navigator.clipboard.writeText(`{content_escaped}`);
94
- </script>
95
- """
96
- column.components.html(js_code, height=0)
97
- column.success("¡Contenido copiado al portapapeles!")
98
-
99
  # Add download button
100
  download_button_key = f"{key_prefix}_download_button"
101
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
@@ -117,6 +104,7 @@ def validate_inputs(audience, product):
117
 
118
  # Make sure to define your UI elements before using them
119
  # Add this before the submit button
 
120
  st.title("Generador de Páginas de Ventas")
121
 
122
  # Load custom CSS from the styles folder
 
78
 
79
  # Modify the display function to preserve content
80
  def display_generated_content(column, content, key_prefix):
81
+ """Display generated content in the specified column with download button."""
82
  if content:
83
  column.markdown("### Contenido generado:")
84
  column.markdown(content)
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  # Add download button
87
  download_button_key = f"{key_prefix}_download_button"
88
  timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
 
104
 
105
  # Make sure to define your UI elements before using them
106
  # Add this before the submit button
107
+ st.set_page_config(layout="wide") # Set the page layout to wide
108
  st.title("Generador de Páginas de Ventas")
109
 
110
  # Load custom CSS from the styles folder