Wajahat698 commited on
Commit
b6ad225
·
verified ·
1 Parent(s): 25e2cb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -58
app.py CHANGED
@@ -114,46 +114,7 @@ def copy_to_clipboard(text):
114
  """
115
  components.html(copy_icon_html, height=60)
116
 
117
- def create_section(title, content, example=None, dark_mode=False):
118
- text_color = "#afafaf" if dark_mode else "#333333"
119
- border_color = "#afafaf" if dark_mode else "#afafaf"
120
-
121
- example_html = f"""<p style="color: {text_color}; font-size: 12px; margin: 5px 0;">{example}</p>""" if example else ''
122
-
123
- section_html = f"""
124
- <div style="
125
- flex: 1;
126
- min-width: 180px;
127
- max-width: 220px;
128
- min-height: 150px;
129
- border: 1px solid {border_color};
130
- border-radius: 10px;
131
- padding: 10px;
132
- background-color: transparent;
133
- margin: 5px;
134
- text-align: center;
135
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
136
- box-sizing: border-box;
137
- font-size: 12px;
138
- ">
139
- <h2 style="
140
- color: {text_color};
141
- font-size: 14px;
142
- margin-bottom: 8px;
143
- border-bottom: 1px solid {border_color};
144
- padding-bottom: 4px;
145
- ">{title}</h2>
146
- <p style="
147
- color: {text_color};
148
- font-size: 11px;
149
- margin: 5px 0;
150
- line-height: 1.4;
151
- ">{content}</p>
152
- {example_html}
153
- </div>
154
- """
155
 
156
- return section_html
157
  def feedback_email(name, email, feedback):
158
  """Sends feedback via email."""
159
  msg = MIMEMultipart()
@@ -407,19 +368,27 @@ if not st.session_state.chat_active:
407
  color: inherit !important;
408
  }
409
 
410
- /* Additional styles */
 
 
 
 
 
 
411
  .section-container {
412
  display: flex;
413
  justify-content: center;
414
  align-items: stretch;
415
  flex-wrap: wrap;
416
  gap: 4px;
 
 
417
  }
418
 
419
  .section {
420
  flex: 1;
421
  min-width: 150px;
422
- max-width: 90px;
423
  min-height: 150px;
424
  border: 1px solid #afafaf;
425
  border-radius: 10px;
@@ -448,7 +417,7 @@ if not st.session_state.chat_active:
448
  line-height: 1.4;
449
  }
450
 
451
- @media (max-width: 100px) {
452
  .section {
453
  min-width: 90%;
454
  max-width: 90%;
@@ -456,30 +425,30 @@ if not st.session_state.chat_active:
456
  }
457
  </style>
458
 
459
- <h1 style="text-align: center; background: linear-gradient(45deg, #4b25ea, #bd18e6, #fb590e); -webkit-background-clip: text; color: transparent;">How can I help you today?</h1>
460
-
461
- <div class="section-container">
462
- <div class="section">
463
- <h2>Find</h2>
464
- <p>Discover all your great TrustBuilders®. <br> Example: Find Development Trust Builders® for World Vision
465
- </div>
466
- <div class="section">
467
- <h2>Create</h2>
468
- <p>Generate trust-optimised solutions : <br>Example: Find World Vision development TrustBuilders®. Then use them to write a 200-word annual report article. Enthusiastic tone.</p>
469
- </div>
470
- <div class="section">
471
- <h2>Trust-optimise</h2>
472
- <p>Paste your LinkedIn profile, EDM or blog and ask TrustAI® to improve it using specific Trust Buckets® and add your specific TrustBuilders® as examples.</p>
 
 
473
  </div>
474
  </div>
475
  """, unsafe_allow_html=True)
476
-
477
  else:
478
  st.empty()
479
 
480
 
481
 
482
-
483
  prompt = st.chat_input("")
484
  if prompt and not st.session_state.chat_active:
485
  st.session_state.chat_active = True
 
114
  """
115
  components.html(copy_icon_html, height=60)
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
 
118
  def feedback_email(name, email, feedback):
119
  """Sends feedback via email."""
120
  msg = MIMEMultipart()
 
368
  color: inherit !important;
369
  }
370
 
371
+ /* Center content */
372
+ .content {
373
+ text-align: center;
374
+ margin: 0 auto;
375
+ }
376
+
377
+ /* Ensure container is centered */
378
  .section-container {
379
  display: flex;
380
  justify-content: center;
381
  align-items: stretch;
382
  flex-wrap: wrap;
383
  gap: 4px;
384
+ margin: 0 auto; /* Center container */
385
+ max-width: 1200px; /* Optional: Adjust based on content width */
386
  }
387
 
388
  .section {
389
  flex: 1;
390
  min-width: 150px;
391
+ max-width: 300px; /* Adjusted width */
392
  min-height: 150px;
393
  border: 1px solid #afafaf;
394
  border-radius: 10px;
 
417
  line-height: 1.4;
418
  }
419
 
420
+ @media (max-width: 600px) {
421
  .section {
422
  min-width: 90%;
423
  max-width: 90%;
 
425
  }
426
  </style>
427
 
428
+ <div class="content">
429
+ <h1 style="background: linear-gradient(45deg, #4b25ea, #bd18e6, #fb590e); -webkit-background-clip: text; color: transparent; font-size: 24px;">How can I help you today?</h1>
430
+
431
+ <div class="section-container">
432
+ <div class="section">
433
+ <h2>Find</h2>
434
+ <p>Discover all your great TrustBuilders®. <br> Example: Find Development Trust Builders® for World Vision</p>
435
+ </div>
436
+ <div class="section">
437
+ <h2>Create</h2>
438
+ <p>Generate trust-optimised solutions : <br>Example: Find World Vision development TrustBuilders®. Then use them to write a 200-word annual report article. Enthusiastic tone.</p>
439
+ </div>
440
+ <div class="section">
441
+ <h2>Trust-optimise</h2>
442
+ <p>Paste your LinkedIn profile, EDM or blog and ask TrustAI® to improve it using specific Trust Buckets® and add your specific TrustBuilders® as examples.</p>
443
+ </div>
444
  </div>
445
  </div>
446
  """, unsafe_allow_html=True)
 
447
  else:
448
  st.empty()
449
 
450
 
451
 
 
452
  prompt = st.chat_input("")
453
  if prompt and not st.session_state.chat_active:
454
  st.session_state.chat_active = True