neologix-p03 commited on
Commit
cce5e71
ยท
1 Parent(s): d194ad3

ADD TEMPALTES

Browse files
Files changed (1) hide show
  1. app.py +188 -54
app.py CHANGED
@@ -125,49 +125,100 @@ def collect_missing_data(profile):
125
  return profile
126
 
127
  def display_success_message(inserted_id, frontend_url):
128
- """Displays a focused success message highlighting both portfolio options"""
129
 
130
  st.balloons() # Add some celebration!
131
 
132
- # Create styles for the portfolio cards
133
  st.markdown("""
134
  <style>
135
- .portfolio-container {
 
 
 
 
 
 
 
 
136
  display: flex;
 
137
  gap: 20px;
138
- margin: 30px 0;
139
- flex-wrap: wrap;
 
 
 
 
 
140
  }
141
- .portfolio-card {
142
- flex: 1;
143
- min-width: 300px;
 
 
 
 
 
144
  background-color: rgba(255, 255, 255, 0.05);
145
  border: 1px solid rgba(150, 150, 150, 0.2);
146
  border-radius: 10px;
147
- padding: 20px;
148
- text-align: center;
149
  }
150
- .portfolio-title {
151
- font-size: 1.5rem;
152
- margin-bottom: 10px;
153
- color: inherit;
154
  }
155
- .portfolio-desc {
156
- font-size: 0.9rem;
157
- margin-bottom: 20px;
158
- color: inherit;
159
- opacity: 0.8;
 
 
 
 
 
160
  }
161
- .portfolio-link {
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  display: inline-block;
163
  background-color: #28a745;
164
  color: white !important;
165
- padding: 10px 20px;
166
  border-radius: 5px;
167
  text-decoration: none;
168
- margin: 10px 0;
169
  font-weight: bold;
170
- font-size: 1.1rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  }
172
  .share-grid {
173
  display: grid;
@@ -188,42 +239,123 @@ def display_success_message(inserted_id, frontend_url):
188
  background-color: rgba(100, 100, 100, 0.1);
189
  transform: translateY(-2px);
190
  }
 
 
 
 
 
 
 
191
  </style>
192
  """, unsafe_allow_html=True)
193
 
194
- # Define portfolio URLs
195
- classic_url = f"https://iportfo.netlify.app/{inserted_id}"
196
- modern_url = f"https://v0-modern-portfolio-react.vercel.app/{inserted_id}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
 
198
  # Success header
199
  st.markdown("""
200
- <div style="text-align: center; margin-bottom: 30px;">
201
- <h1 style="color: #28a745;">๐ŸŽ‰ Your Portfolio is Ready!</h1>
202
- <p style="color: inherit;">Choose from two beautiful portfolio designs</p>
203
  </div>
204
  """, unsafe_allow_html=True)
205
 
206
- # Portfolio cards
207
- st.markdown(f"""
208
- <div class="portfolio-container">
209
- <div class="portfolio-card">
210
- <h2 class="portfolio-title">๐ŸŽจ Classic Portfolio</h2>
211
- <p class="portfolio-desc">Clean and professional design showcasing your experience in a traditional layout</p>
212
- <a href="{classic_url}" target="_blank" class="portfolio-link">
213
- View Classic Design ๐Ÿš€
214
- </a>
215
- </div>
216
- <div class="portfolio-card">
217
- <h2 class="portfolio-title">โœจ Modern Portfolio (Beta)</h2>
218
- <p class="portfolio-desc">Contemporary and dynamic design with enhanced visual elements</p>
219
- <a href="{modern_url}" target="_blank" class="portfolio-link">
220
- Try Modern Design ๐ŸŽฏ
221
- </a>
222
- </div>
223
- </div>
224
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
  # Share section
 
227
  st.subheader("๐Ÿ“ค Share Your Portfolio")
228
 
229
  # Define share messages
@@ -232,9 +364,9 @@ def display_success_message(inserted_id, frontend_url):
232
  whatsapp_msg = "Hi! I wanted to share my professional portfolio with you. Take a look!"
233
 
234
  # Create share URLs
235
- linkedin_share_url = f"https://www.linkedin.com/sharing/share-offsite/?url={classic_url}&summary={linkedin_msg}"
236
- twitter_share_url = f"https://twitter.com/intent/tweet?text={twitter_msg}&url={classic_url}"
237
- whatsapp_share_url = f"https://wa.me/?text={whatsapp_msg}%20{classic_url}"
238
 
239
  # Share buttons
240
  st.markdown(f"""
@@ -262,11 +394,13 @@ def display_success_message(inserted_id, frontend_url):
262
  </a>
263
  </div>
264
  """, unsafe_allow_html=True)
 
265
 
266
- # Portfolio IDs
267
  st.markdown(f"""
268
- <div style="margin-top: 30px; text-align: center;">
269
- <p style="color: inherit;">Your Portfolio ID: <code>{inserted_id}</code></p>
 
270
  </div>
271
  """, unsafe_allow_html=True)
272
 
 
125
  return profile
126
 
127
  def display_success_message(inserted_id, frontend_url):
128
+ """Displays a focused success message highlighting all portfolio templates"""
129
 
130
  st.balloons() # Add some celebration!
131
 
132
+ # Create styles for the portfolio templates display
133
  st.markdown("""
134
  <style>
135
+ .success-header {
136
+ text-align: center;
137
+ margin-bottom: 30px;
138
+ }
139
+ .success-header h1 {
140
+ color: #28a745;
141
+ margin-bottom: 10px;
142
+ }
143
+ .templates-container {
144
  display: flex;
145
+ flex-direction: column;
146
  gap: 20px;
147
+ margin: 20px 0;
148
+ }
149
+ .category-title {
150
+ margin: 10px 0;
151
+ padding-bottom: 5px;
152
+ border-bottom: 1px solid rgba(150, 150, 150, 0.2);
153
+ font-size: 1.3rem;
154
  }
155
+ .templates-grid {
156
+ display: grid;
157
+ grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
158
+ gap: 15px;
159
+ }
160
+ .template-card {
161
+ display: flex;
162
+ flex-direction: column;
163
  background-color: rgba(255, 255, 255, 0.05);
164
  border: 1px solid rgba(150, 150, 150, 0.2);
165
  border-radius: 10px;
166
+ overflow: hidden;
167
+ transition: transform 0.3s, box-shadow 0.3s;
168
  }
169
+ .template-card:hover {
170
+ transform: translateY(-5px);
171
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
 
172
  }
173
+ .template-image {
174
+ width: 100%;
175
+ height: 150px;
176
+ background-color: rgba(100, 100, 100, 0.1);
177
+ display: flex;
178
+ justify-content: center;
179
+ align-items: center;
180
+ }
181
+ .template-info {
182
+ padding: 15px;
183
  }
184
+ .template-name {
185
+ font-size: 1.2rem;
186
+ font-weight: bold;
187
+ margin-bottom: 5px;
188
+ display: flex;
189
+ justify-content: space-between;
190
+ align-items: center;
191
+ }
192
+ .template-category {
193
+ font-size: 0.85rem;
194
+ opacity: 0.7;
195
+ margin-bottom: 15px;
196
+ }
197
+ .template-link {
198
  display: inline-block;
199
  background-color: #28a745;
200
  color: white !important;
201
+ padding: 8px 16px;
202
  border-radius: 5px;
203
  text-decoration: none;
 
204
  font-weight: bold;
205
+ transition: background-color 0.3s;
206
+ text-align: center;
207
+ }
208
+ .template-link:hover {
209
+ background-color: #218838;
210
+ }
211
+ .premium-badge {
212
+ display: inline-block;
213
+ background-color: #ffc107;
214
+ color: #212529;
215
+ font-size: 0.7rem;
216
+ padding: 2px 6px;
217
+ border-radius: 10px;
218
+ margin-left: 10px;
219
+ }
220
+ .share-section {
221
+ margin-top: 40px;
222
  }
223
  .share-grid {
224
  display: grid;
 
239
  background-color: rgba(100, 100, 100, 0.1);
240
  transform: translateY(-2px);
241
  }
242
+ .portfolio-id {
243
+ margin-top: 30px;
244
+ text-align: center;
245
+ padding: 10px;
246
+ background-color: rgba(40, 167, 69, 0.1);
247
+ border-radius: 5px;
248
+ }
249
  </style>
250
  """, unsafe_allow_html=True)
251
 
252
+ # Define all templates with their details
253
+ templates = [
254
+ {
255
+ "id": 1,
256
+ "name": "Clean Portfolio",
257
+ "category": "professional",
258
+ "url": f"https://v0-recreate-figma-ui-dua1ta.vercel.app/{inserted_id}",
259
+ "isPremium": False
260
+ },
261
+ {
262
+ "id": 2,
263
+ "name": "Creative Designer",
264
+ "category": "creative",
265
+ "url": f"https://v0-recreate-figma-ui-f7.vercel.app/{inserted_id}",
266
+ "isPremium": True
267
+ },
268
+ {
269
+ "id": 3,
270
+ "name": "iPortfo",
271
+ "category": "tech",
272
+ "url": f"https://iportfo.netlify.app/{inserted_id}",
273
+ "isPremium": False
274
+ },
275
+ {
276
+ "id": 4,
277
+ "name": "Modern Portfolio",
278
+ "category": "professional",
279
+ "url": f"https://v0-modern-portfolio-react.vercel.app/{inserted_id}",
280
+ "isPremium": False
281
+ },
282
+ {
283
+ "id": 5,
284
+ "name": "Data Science Portfolio",
285
+ "category": "tech",
286
+ "url": f"https://v0-portfolio-web-application.vercel.app/{inserted_id}",
287
+ "isPremium": False
288
+ },
289
+ {
290
+ "id": 6,
291
+ "name": "VimFolio Portfolio",
292
+ "category": "special",
293
+ "url": f"https://v0-dynamic-portfolio-app.vercel.app/sample/{inserted_id}",
294
+ "isPremium": True
295
+ },
296
+ {
297
+ "id": 7,
298
+ "name": "AI Portfolio",
299
+ "category": "special",
300
+ "url": f"https://v0-portfolio-data-integration.vercel.app/{inserted_id}",
301
+ "isPremium": True
302
+ }
303
+ ]
304
+
305
+ # Group templates by category
306
+ categories = {}
307
+ for template in templates:
308
+ category = template["category"].capitalize()
309
+ if category not in categories:
310
+ categories[category] = []
311
+ categories[category].append(template)
312
 
313
  # Success header
314
  st.markdown("""
315
+ <div class="success-header">
316
+ <h1>๐ŸŽ‰ Your Portfolio is Ready!</h1>
317
+ <p>Choose from our diverse collection of beautiful portfolio templates</p>
318
  </div>
319
  """, unsafe_allow_html=True)
320
 
321
+ # Display templates by category
322
+ st.markdown('<div class="templates-container">', unsafe_allow_html=True)
323
+
324
+ for category, category_templates in categories.items():
325
+ st.markdown(f'<h2 class="category-title">{category} Templates</h2>', unsafe_allow_html=True)
326
+ st.markdown('<div class="templates-grid">', unsafe_allow_html=True)
327
+
328
+ for template in category_templates:
329
+ premium_badge = '<span class="premium-badge">Premium</span>' if template["isPremium"] else ''
330
+
331
+ st.markdown(f"""
332
+ <div class="template-card">
333
+ <div class="template-image">
334
+ <span style="font-size: 2rem;">๐Ÿ–ผ๏ธ</span>
335
+ </div>
336
+ <div class="template-info">
337
+ <div class="template-name">
338
+ {template["name"]} {premium_badge}
339
+ </div>
340
+ <div class="template-category">
341
+ {category}
342
+ </div>
343
+ <a href="{template["url"]}" target="_blank" class="template-link">
344
+ View Portfolio
345
+ </a>
346
+ </div>
347
+ </div>
348
+ """, unsafe_allow_html=True)
349
+
350
+ st.markdown('</div>', unsafe_allow_html=True)
351
+
352
+ st.markdown('</div>', unsafe_allow_html=True)
353
+
354
+ # Select primary URL for sharing (use iPortfo as default)
355
+ primary_share_url = next((t["url"] for t in templates if t["name"] == "iPortfo"), templates[0]["url"])
356
 
357
  # Share section
358
+ st.markdown('<div class="share-section">', unsafe_allow_html=True)
359
  st.subheader("๐Ÿ“ค Share Your Portfolio")
360
 
361
  # Define share messages
 
364
  whatsapp_msg = "Hi! I wanted to share my professional portfolio with you. Take a look!"
365
 
366
  # Create share URLs
367
+ linkedin_share_url = f"https://www.linkedin.com/sharing/share-offsite/?url={primary_share_url}&summary={linkedin_msg}"
368
+ twitter_share_url = f"https://twitter.com/intent/tweet?text={twitter_msg}&url={primary_share_url}"
369
+ whatsapp_share_url = f"https://wa.me/?text={whatsapp_msg}%20{primary_share_url}"
370
 
371
  # Share buttons
372
  st.markdown(f"""
 
394
  </a>
395
  </div>
396
  """, unsafe_allow_html=True)
397
+ st.markdown('</div>', unsafe_allow_html=True)
398
 
399
+ # Portfolio ID
400
  st.markdown(f"""
401
+ <div class="portfolio-id">
402
+ <p>Your Portfolio ID: <code>{inserted_id}</code></p>
403
+ <small>Use this ID to access your portfolio from anywhere</small>
404
  </div>
405
  """, unsafe_allow_html=True)
406