sunbal7 commited on
Commit
c10c05c
Β·
verified Β·
1 Parent(s): 7337843

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -57,6 +57,13 @@ st.markdown("""
57
  border-radius: 15px;
58
  background: linear-gradient(90deg, #FF6B6B 0%, #4ECDC4 100%);
59
  }
 
 
 
 
 
 
 
60
  </style>
61
  """, unsafe_allow_html=True)
62
 
@@ -100,7 +107,6 @@ Make it inspirational and include an emoji."""
100
  )
101
  return response.choices[0].message.content
102
 
103
-
104
  def generate_tips(traits):
105
  """Generate evidence-based psychological tips for all traits"""
106
  tips = []
@@ -194,7 +200,8 @@ def create_pdf_report(report):
194
  report['quote'],
195
  "",
196
  "Growth Tips:",
197
- *[f"{i+1}. {tip}" for i, tip in enumerate(report['tips'])]]
 
198
 
199
  for line in content:
200
  p.drawString(100, y_position, line)
@@ -268,9 +275,13 @@ else:
268
  st.markdown("### πŸ’¬ Personalized Wisdom")
269
  st.success(f'"{report["quote"]}"')
270
  with col2:
271
- st.markdown("### πŸ› οΈ Actionable Tips")
272
- for tip in report['tips']:
273
- st.markdown(f"- {tip}")
 
 
 
 
274
 
275
  # PDF Report
276
  pdf_buffer = create_pdf_report(report)
@@ -280,15 +291,7 @@ else:
280
  file_name="psych_profile.pdf",
281
  mime="application/pdf"
282
  )
283
- # In the report display section:
284
- with col2:
285
- st.markdown("### πŸ› οΈ Actionable Psychology Hacks")
286
- for i, tip in enumerate(report['tips']):
287
- st.markdown(f"""
288
- <div style="border-left: 3px solid #4CAF50; padding-left: 10px; margin: 5px 0;">
289
- {i+1}. {tip}
290
- </div>
291
- """, unsafe_allow_html=True)
292
  # Sidebar
293
  with st.sidebar:
294
  st.markdown("## 🌈 How It Works")
 
57
  border-radius: 15px;
58
  background: linear-gradient(90deg, #FF6B6B 0%, #4ECDC4 100%);
59
  }
60
+ .tip-box {
61
+ border-left: 4px solid #4CAF50;
62
+ padding: 10px 15px;
63
+ margin: 10px 0;
64
+ background: #f8f9fa;
65
+ border-radius: 5px;
66
+ }
67
  </style>
68
  """, unsafe_allow_html=True)
69
 
 
107
  )
108
  return response.choices[0].message.content
109
 
 
110
  def generate_tips(traits):
111
  """Generate evidence-based psychological tips for all traits"""
112
  tips = []
 
200
  report['quote'],
201
  "",
202
  "Growth Tips:",
203
+ *[f"{i+1}. {tip}" for i, tip in enumerate(report['tips'])]
204
+ ]
205
 
206
  for line in content:
207
  p.drawString(100, y_position, line)
 
275
  st.markdown("### πŸ’¬ Personalized Wisdom")
276
  st.success(f'"{report["quote"]}"')
277
  with col2:
278
+ st.markdown("### πŸ› οΈ Actionable Psychology Hacks")
279
+ for i, tip in enumerate(report['tips']):
280
+ st.markdown(f"""
281
+ <div class="tip-box">
282
+ <strong>#{i+1}</strong> {tip}
283
+ </div>
284
+ """, unsafe_allow_html=True)
285
 
286
  # PDF Report
287
  pdf_buffer = create_pdf_report(report)
 
291
  file_name="psych_profile.pdf",
292
  mime="application/pdf"
293
  )
294
+
 
 
 
 
 
 
 
 
295
  # Sidebar
296
  with st.sidebar:
297
  st.markdown("## 🌈 How It Works")