Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,7 +143,6 @@ def create_dataframe_category(category, title, emoji_prefix):
|
|
| 143 |
st.markdown(f"<div class='category-header'>{emoji_prefix} {title}</div>", unsafe_allow_html=True)
|
| 144 |
st.markdown("<div class='dataframe-container'>", unsafe_allow_html=True)
|
| 145 |
|
| 146 |
-
# Create 4 columns for layout
|
| 147 |
cols = st.columns(4)
|
| 148 |
for i, item in enumerate(data[f"{category}s"]):
|
| 149 |
col = cols[i % 4]
|
|
@@ -204,13 +203,13 @@ with col1:
|
|
| 204 |
value=st.session_state.selections['about'],
|
| 205 |
placeholder="Enter what the content should be about")
|
| 206 |
|
| 207 |
-
|
| 208 |
-
|
|
|
|
| 209 |
st.session_state.selections['inclusion'] = st.text_input("β
Include",
|
| 210 |
value=st.session_state.selections['inclusion'],
|
| 211 |
placeholder="What to include in the content")
|
| 212 |
-
|
| 213 |
-
with col2:
|
| 214 |
st.session_state.selections['exclusion'] = st.text_input("β Exclude",
|
| 215 |
value=st.session_state.selections['exclusion'],
|
| 216 |
placeholder="What to exclude from the content")
|
|
@@ -231,21 +230,20 @@ with col2:
|
|
| 231 |
st.write(prompt)
|
| 232 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 233 |
|
| 234 |
-
|
| 235 |
-
|
|
|
|
| 236 |
if st.button("π Copy", type="primary", use_container_width=True):
|
| 237 |
st.code(prompt, language="")
|
| 238 |
-
|
| 239 |
-
with btn2:
|
| 240 |
if st.button("π Reset", type="secondary", use_container_width=True):
|
| 241 |
for key in st.session_state.selections:
|
| 242 |
if key in ['about', 'inclusion', 'exclusion', 'input_data']:
|
| 243 |
st.session_state.selections[key] = ""
|
| 244 |
else:
|
| 245 |
st.session_state.selections[key] = None
|
| 246 |
-
st.rerun()
|
| 247 |
-
|
| 248 |
-
with btn3:
|
| 249 |
if st.button("π² Random", type="secondary", use_container_width=True):
|
| 250 |
for category in ['role', 'tone', 'instruction', 'length', 'content_type', 'audience', 'format']:
|
| 251 |
st.session_state.selections[category] = random.choice(data[category+'s'])
|
|
@@ -270,7 +268,7 @@ Return as π Markdown.</pre>
|
|
| 270 |
|
| 271 |
st.markdown("""
|
| 272 |
<div style="background-color: #e6ffed; border: 1px solid #b8e6cc; border-radius: 4px; padding: 6px; margin-bottom: 6px; font-size: 0.8em;">
|
| 273 |
-
<b>πΌ Business</b><pre style="white-space: pre-wrap; font-size: 0.8em; margin: 3px 0px;">Act as a π Professional, use π€ Persuasive tone, Write a π§ Email for
|
| 274 |
|
| 275 |
It should be about a product launch.
|
| 276 |
Include ROI metrics.
|
|
|
|
| 143 |
st.markdown(f"<div class='category-header'>{emoji_prefix} {title}</div>", unsafe_allow_html=True)
|
| 144 |
st.markdown("<div class='dataframe-container'>", unsafe_allow_html=True)
|
| 145 |
|
|
|
|
| 146 |
cols = st.columns(4)
|
| 147 |
for i, item in enumerate(data[f"{category}s"]):
|
| 148 |
col = cols[i % 4]
|
|
|
|
| 203 |
value=st.session_state.selections['about'],
|
| 204 |
placeholder="Enter what the content should be about")
|
| 205 |
|
| 206 |
+
# Use a single-level column for Include/Exclude
|
| 207 |
+
include_exclude_cols = st.columns(2)
|
| 208 |
+
with include_exclude_cols[0]:
|
| 209 |
st.session_state.selections['inclusion'] = st.text_input("β
Include",
|
| 210 |
value=st.session_state.selections['inclusion'],
|
| 211 |
placeholder="What to include in the content")
|
| 212 |
+
with include_exclude_cols[1]:
|
|
|
|
| 213 |
st.session_state.selections['exclusion'] = st.text_input("β Exclude",
|
| 214 |
value=st.session_state.selections['exclusion'],
|
| 215 |
placeholder="What to exclude from the content")
|
|
|
|
| 230 |
st.write(prompt)
|
| 231 |
st.markdown("</div>", unsafe_allow_html=True)
|
| 232 |
|
| 233 |
+
# Define button columns at this level
|
| 234 |
+
button_cols = st.columns(3)
|
| 235 |
+
with button_cols[0]:
|
| 236 |
if st.button("π Copy", type="primary", use_container_width=True):
|
| 237 |
st.code(prompt, language="")
|
| 238 |
+
with button_cols[1]:
|
|
|
|
| 239 |
if st.button("π Reset", type="secondary", use_container_width=True):
|
| 240 |
for key in st.session_state.selections:
|
| 241 |
if key in ['about', 'inclusion', 'exclusion', 'input_data']:
|
| 242 |
st.session_state.selections[key] = ""
|
| 243 |
else:
|
| 244 |
st.session_state.selections[key] = None
|
| 245 |
+
st.rerun()
|
| 246 |
+
with button_cols[2]:
|
|
|
|
| 247 |
if st.button("π² Random", type="secondary", use_container_width=True):
|
| 248 |
for category in ['role', 'tone', 'instruction', 'length', 'content_type', 'audience', 'format']:
|
| 249 |
st.session_state.selections[category] = random.choice(data[category+'s'])
|
|
|
|
| 268 |
|
| 269 |
st.markdown("""
|
| 270 |
<div style="background-color: #e6ffed; border: 1px solid #b8e6cc; border-radius: 4px; padding: 6px; margin-bottom: 6px; font-size: 0.8em;">
|
| 271 |
+
<b>πΌ Business</b><pre style="white-space: pre-wrap; font-size: 0.8em; margin: 3px 0px;">Act as a π Professional, use π€ Persuasive tone, Write a π§ Email for πΌ Business Owners.
|
| 272 |
|
| 273 |
It should be about a product launch.
|
| 274 |
Include ROI metrics.
|