awacke1 commited on
Commit
c73f4b8
Β·
verified Β·
1 Parent(s): 2960f9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -48
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 two columns
162
  left_col, right_col = st.columns([3, 1])
163
 
164
  with left_col:
165
- # First row of categories in 3 columns
166
- row1_col1, row1_col2, row1_col3 = st.columns(3)
 
 
 
 
 
 
167
 
168
- with row1_col1:
169
- create_category_container("Role", data['roles'], "πŸ‘€")
170
- create_category_container("Instruction", data['instructions'], "πŸ“")
171
 
172
- with row1_col2:
173
- create_category_container("Tone", data['tones'], "🎭")
174
- create_category_container("Length", data['lengths'], "πŸ“")
 
175
 
176
- with row1_col3:
177
- create_category_container("Content Type", data['content_types'], "πŸ“„")
178
- create_category_container("Audience", data['audiences'], "πŸ‘₯")
179
 
180
- # Second row for Format and Text inputs
181
- row2 = st.container()
182
- with row2:
183
- row2_col1, row2_col2 = st.columns([1, 3])
184
-
185
- with row2_col1:
186
- create_category_container("Format", data['formats'], "πŸ“‹")
187
-
188
- with row2_col2:
189
- # Use a container for text inputs
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):