JeCabrera commited on
Commit
5a9a4db
·
verified ·
1 Parent(s): 5a831ce

Upload 9 files

Browse files
Files changed (2) hide show
  1. app.py +1 -19
  2. styles/main.css +4 -94
app.py CHANGED
@@ -3,7 +3,6 @@ import streamlit as st
3
  import os
4
  import google.generativeai as genai
5
  import random
6
- import datetime
7
  from streamlit import session_state as state
8
  from formulas import email_formulas # Updated import statement
9
  from angles import angles
@@ -402,29 +401,12 @@ if submit:
402
  )
403
 
404
  # Display the generated emails in col2 (still within col2 context)
405
- # Procesar el texto para mejorar el formato
406
- formatted_emails = generated_emails.replace("---", "<hr class='email-divider'>")
407
- formatted_emails = formatted_emails.replace("ASUNTO:", "<strong class='email-subject'>ASUNTO:</strong>")
408
-
409
  st.markdown(f"""
410
  <div class="results-container">
411
  <h4>Tus emails persuasivos:</h4>
412
- <div class="email-content">{formatted_emails}</div>
413
  </div>
414
  """, unsafe_allow_html=True)
415
-
416
- # Add download button for the generated emails
417
- if generated_emails:
418
- # Get current timestamp for the filename
419
- timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
420
-
421
- # Download button
422
- st.download_button(
423
- label="DESCARGAR EMAILS",
424
- data=generated_emails,
425
- file_name=f"emails_persuasivos_{timestamp}.txt",
426
- mime="text/plain"
427
- )
428
  except ValueError as e:
429
  col2.error(f"Error: {str(e)}")
430
  else:
 
3
  import os
4
  import google.generativeai as genai
5
  import random
 
6
  from streamlit import session_state as state
7
  from formulas import email_formulas # Updated import statement
8
  from angles import angles
 
401
  )
402
 
403
  # Display the generated emails in col2 (still within col2 context)
 
 
 
 
404
  st.markdown(f"""
405
  <div class="results-container">
406
  <h4>Tus emails persuasivos:</h4>
407
+ <p>{generated_emails}</p>
408
  </div>
409
  """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  except ValueError as e:
411
  col2.error(f"Error: {str(e)}")
412
  else:
styles/main.css CHANGED
@@ -37,101 +37,11 @@ div.stButton > button:hover {
37
  }
38
 
39
  /* Results container */
40
- /* Add these styles for the download button */
41
- [data-testid="stDownloadButton"] {
42
- text-align: center;
43
- display: flex;
44
- justify-content: center;
45
- margin-top: 5px;
46
- width: 90%;
47
- margin-left: auto;
48
- margin-right: auto;
49
- }
50
-
51
- [data-testid="stDownloadButton"] button {
52
- width: 100%;
53
- border-radius: 5px;
54
- height: 3em;
55
- background: linear-gradient(to right, #00D100, #009900);
56
- color: white;
57
- font-weight: bold;
58
- transition: all 0.3s ease;
59
- border: none;
60
- text-transform: uppercase;
61
- letter-spacing: 1px;
62
- }
63
-
64
- [data-testid="stDownloadButton"] button:hover {
65
- background: linear-gradient(to right, #00C000, #008800);
66
- transform: translateY(-2px);
67
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
68
- }
69
-
70
- /* Existing styles for the results container */
71
- /* Estilos para los emails generados */
72
- .email-content {
73
- font-family: 'Arial', sans-serif;
74
- line-height: 1.5;
75
- white-space: pre-wrap;
76
- }
77
-
78
- .email-divider {
79
- margin: 20px 0;
80
- border: 0;
81
- border-top: 1px solid #ddd;
82
- }
83
-
84
- .email-subject {
85
- color: #2c3e50;
86
- font-size: 1.1em;
87
- display: block;
88
- margin-top: 15px;
89
- margin-bottom: 10px;
90
- }
91
-
92
  .results-container {
93
- background-color: #f9f9f9;
94
- border-radius: 10px;
95
- padding: 20px;
96
- margin-top: 20px;
97
- border: 1px solid #ddd;
98
- }
99
-
100
- .results-container h4 {
101
- color: #333;
102
- margin-bottom: 15px;
103
- border-bottom: 1px solid #eee;
104
- padding-bottom: 10px;
105
- }
106
-
107
- /* Estilos para el botón de descarga */
108
- [data-testid="stDownloadButton"] {
109
- text-align: center;
110
- display: flex;
111
- justify-content: center;
112
- margin-top: 15px;
113
- width: 90%;
114
- margin-left: auto;
115
- margin-right: auto;
116
- }
117
-
118
- [data-testid="stDownloadButton"] button {
119
- width: 100%;
120
- border-radius: 5px;
121
- height: 3em;
122
- background: linear-gradient(to right, #00D100, #009900);
123
- color: white;
124
- font-weight: bold;
125
- transition: all 0.3s ease;
126
- border: none;
127
- text-transform: uppercase;
128
- letter-spacing: 1px;
129
- }
130
-
131
- [data-testid="stDownloadButton"] button:hover {
132
- background: linear-gradient(to right, #00C000, #008800);
133
- transform: translateY(-2px);
134
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
135
  }
136
 
137
  /* Email content styling */
 
37
  }
38
 
39
  /* Results container */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  .results-container {
41
+ border: 1px solid #000000;
42
+ padding: 15px;
43
+ border-radius: 8px;
44
+ background-color: #ffffff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
 
47
  /* Email content styling */