Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -158,60 +158,42 @@ def create_category_container(category_name, items, emoji_prefix=""):
|
|
158 |
# Minimal header
|
159 |
st.markdown("<h2 style='text-align: center; font-size: 1.2rem;'><span class='emoji'>π§ </span> ChatGPT Prompt Generator</h2>", unsafe_allow_html=True)
|
160 |
|
161 |
-
# Main layout with
|
162 |
left_col, right_col = st.columns([3, 1])
|
163 |
|
164 |
with left_col:
|
165 |
-
#
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
175 |
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
st.markdown('<div class="category-container">', unsafe_allow_html=True)
|
191 |
-
st.markdown('<div class="section-header">π Details</div>', unsafe_allow_html=True)
|
192 |
-
|
193 |
-
# Create text inputs
|
194 |
-
st.session_state.selections['about'] = st.text_input("π¬ Topic",
|
195 |
-
value=st.session_state.selections['about'],
|
196 |
-
placeholder="Enter what the content should be about")
|
197 |
-
|
198 |
-
col1, col2 = st.columns(2)
|
199 |
-
with col1:
|
200 |
-
st.session_state.selections['inclusion'] = st.text_input("β
Include",
|
201 |
-
value=st.session_state.selections['inclusion'],
|
202 |
-
placeholder="What to include in the content")
|
203 |
-
|
204 |
-
with col2:
|
205 |
-
st.session_state.selections['exclusion'] = st.text_input("β Exclude",
|
206 |
-
value=st.session_state.selections['exclusion'],
|
207 |
-
placeholder="What to exclude from the content")
|
208 |
-
|
209 |
-
st.session_state.selections['input_data'] = st.text_area("π Input Data",
|
210 |
-
value=st.session_state.selections['input_data'],
|
211 |
-
placeholder="Enter any specific information to use",
|
212 |
-
height=60)
|
213 |
-
|
214 |
-
st.markdown('</div>', unsafe_allow_html=True)
|
215 |
|
216 |
with right_col:
|
217 |
# Generate prompt based on selections
|
@@ -248,7 +230,7 @@ It should be about {sel['about']}."""
|
|
248 |
st.write(prompt)
|
249 |
st.markdown('</div>', unsafe_allow_html=True)
|
250 |
|
251 |
-
# Action buttons
|
252 |
btn1, btn2, btn3 = st.columns(3)
|
253 |
with btn1:
|
254 |
if st.button("π Copy", type="primary", use_container_width=True):
|
|
|
158 |
# Minimal header
|
159 |
st.markdown("<h2 style='text-align: center; font-size: 1.2rem;'><span class='emoji'>π§ </span> ChatGPT Prompt Generator</h2>", unsafe_allow_html=True)
|
160 |
|
161 |
+
# Main layout with columns - only one level
|
162 |
left_col, right_col = st.columns([3, 1])
|
163 |
|
164 |
with left_col:
|
165 |
+
# Add all categories in separate containers without nesting columns
|
166 |
+
create_category_container("Role", data['roles'], "π€")
|
167 |
+
create_category_container("Tone", data['tones'], "π")
|
168 |
+
create_category_container("Instruction", data['instructions'], "π")
|
169 |
+
create_category_container("Length", data['lengths'], "π")
|
170 |
+
create_category_container("Content Type", data['content_types'], "π")
|
171 |
+
create_category_container("Audience", data['audiences'], "π₯")
|
172 |
+
create_category_container("Format", data['formats'], "π")
|
173 |
|
174 |
+
# Add text inputs directly (no columns)
|
175 |
+
st.markdown('<div class="category-container">', unsafe_allow_html=True)
|
176 |
+
st.markdown('<div class="section-header">π Details</div>', unsafe_allow_html=True)
|
177 |
|
178 |
+
# Create text inputs
|
179 |
+
st.session_state.selections['about'] = st.text_input("π¬ Topic",
|
180 |
+
value=st.session_state.selections['about'],
|
181 |
+
placeholder="Enter what the content should be about")
|
182 |
|
183 |
+
st.session_state.selections['inclusion'] = st.text_input("β
Include",
|
184 |
+
value=st.session_state.selections['inclusion'],
|
185 |
+
placeholder="What to include in the content")
|
186 |
|
187 |
+
st.session_state.selections['exclusion'] = st.text_input("β Exclude",
|
188 |
+
value=st.session_state.selections['exclusion'],
|
189 |
+
placeholder="What to exclude from the content")
|
190 |
+
|
191 |
+
st.session_state.selections['input_data'] = st.text_area("π Input Data",
|
192 |
+
value=st.session_state.selections['input_data'],
|
193 |
+
placeholder="Enter any specific information to use",
|
194 |
+
height=60)
|
195 |
+
|
196 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
|
198 |
with right_col:
|
199 |
# Generate prompt based on selections
|
|
|
230 |
st.write(prompt)
|
231 |
st.markdown('</div>', unsafe_allow_html=True)
|
232 |
|
233 |
+
# Action buttons - use one set of columns at top level
|
234 |
btn1, btn2, btn3 = st.columns(3)
|
235 |
with btn1:
|
236 |
if st.button("π Copy", type="primary", use_container_width=True):
|