Update src/contact.py

#35
by KhaqanNasir - opened
Files changed (1) hide show
  1. src/contact.py +294 -93
src/contact.py CHANGED
@@ -1,104 +1,130 @@
1
  import streamlit as st
2
 
3
  def main():
4
- # Custom CSS for Contact page
5
  st.markdown("""
6
  <style>
7
- @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
 
 
 
 
 
8
 
9
  .stApp {
10
- font-family: 'Poppins', sans-serif;
11
- background: #f8fafc;
12
  min-height: 100vh;
13
- color: #1a202c;
 
 
14
  }
15
 
16
- #MainMenu {visibility: visible;}
17
  footer {visibility: hidden;}
18
  .stDeployButton {display: none;}
19
  header {visibility: hidden;}
20
  .stApp > header {visibility: hidden;}
21
 
22
- .container {
23
- max-width: 1200px;
 
 
24
  margin: 0 auto;
25
- padding: 1.5rem;
26
  }
27
 
28
- .header {
29
- padding: 1.5rem 0;
30
  text-align: center;
 
 
31
  }
32
 
33
  .header-title {
34
- font-size: 2.5rem;
35
  font-weight: 700;
36
- color: #1a202c;
37
- display: inline-flex;
38
- align-items: center;
39
- gap: 0.5rem;
 
 
 
 
 
 
40
  }
41
 
 
42
  .section {
43
- margin-bottom: 2rem;
 
 
 
44
  }
45
 
46
  .section-title {
47
- font-size: 2rem;
48
  font-weight: 600;
49
- color: #1a202c;
50
- margin-bottom: 0.5rem;
51
- display: flex;
52
- align-items: center;
53
- gap: 0.5rem;
54
  }
55
 
56
- .section-text {
57
- font-size: 1.1rem;
58
- color: #4a5568;
59
- line-height: 1.5;
60
- max-width: 800px;
61
- margin: 0 auto;
 
62
  }
63
 
64
- .contact-container {
65
- display: flex;
 
 
66
  gap: 2rem;
67
- flex-wrap: wrap;
 
 
68
  }
69
 
70
- .contact-form {
71
- flex: 1;
72
- min-width: 300px;
 
 
73
  }
74
 
75
- .map-container {
76
- flex: 1;
77
- min-width: 300px;
 
 
 
78
  }
79
 
80
- .map-container iframe {
81
- width: 100%;
82
- height: 400px;
83
- border: none;
84
- border-radius: 8px;
85
  }
86
 
 
87
  .stTextInput > div > div > input,
88
  .stTextArea > div > div > textarea {
89
- border-radius: 8px !important;
90
  border: 1px solid #d1d5db !important;
91
- padding: 1rem !important;
92
- font-size: 1.1rem !important;
93
- font-family: 'Poppins', sans-serif !important;
94
  background: #ffffff !important;
95
- transition: all 0.2s ease !important;
96
  }
97
 
98
  .stTextInput > div > div > input:focus,
99
  .stTextArea > div > div > textarea:focus {
100
- border-color: #6366f1 !important;
101
- box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1) !important;
102
  outline: none !important;
103
  }
104
 
@@ -107,82 +133,257 @@ def main():
107
  color: #9ca3af !important;
108
  }
109
 
 
110
  .stButton > button {
111
- background: #6366f1 !important;
112
  color: white !important;
113
- border-radius: 8px !important;
114
- padding: 0.75rem 2rem !important;
115
- font-size: 1.1rem !important;
116
- font-weight: 600 !important;
117
- font-family: 'Poppins', sans-serif !important;
118
- transition: all 0.2s ease !important;
119
  border: none !important;
120
  width: 100% !important;
121
  }
122
 
123
  .stButton > button:hover {
124
- background: #4f46e5 !important;
125
- transform: translateY(-1px) !important;
126
  }
127
 
128
- .stSidebar {
129
- background: #ffffff;
130
- border-right: 1px solid #e5e7eb;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  }
132
 
133
- .stSidebar .sidebar-content {
134
- padding: 1rem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
  </style>
137
  """, unsafe_allow_html=True)
138
 
 
 
 
 
 
 
 
 
 
 
139
 
140
-
141
- # Header
142
  st.markdown("""
143
- <div class="header">
144
- <div class="container">
145
- <h1 class="header-title">πŸ›‘οΈ TruthCheck</h1>
146
- </div>
 
147
  </div>
148
  """, unsafe_allow_html=True)
149
 
150
- # Contact Content
 
 
 
151
  st.markdown("""
152
- <div class="container">
153
- <div class="section">
154
- <h2 class="section-title">πŸ“¬ Get in Touch</h2>
155
- <p class="section-text">
156
- Have questions or feedback? Reach out to us via the form below or visit our office. We're here to help!
157
- </p>
158
- </div>
159
- <div class="contact-container">
160
- <div class="contact-form">
161
- <h3 class="section-title">πŸ“© Contact Form</h3>
162
  """, unsafe_allow_html=True)
163
 
164
  # Contact Form
165
- with st.form(key="contact_form"):
166
- name = st.text_input("Name", placeholder="Your full name")
167
- email = st.text_input("Email", placeholder="Your email address")
168
- message = st.text_area("Message", placeholder="Your message or inquiry", height=150)
 
 
 
 
 
 
 
169
  submit_button = st.form_submit_button("Send Message")
170
 
171
  if submit_button:
172
- if name and email and message:
173
- st.success("Thank you for your message! We'll get back to you soon.")
174
  else:
175
- st.error("Please fill out all fields before submitting.")
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  st.markdown("""
178
- </div>
179
- <div class="map-container">
180
- <h3 class="section-title">πŸ“ Our Location</h3>
181
- <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3151.835434509374!2d144.9537363153167!3d-37.81627927975195!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x6ad642af0f11fd81%3A0xf577d9d9a9a9a9a9!2sMelbourne%20VIC%2C%20Australia!5e0!3m2!1sen!2sus!4v1634567891234" allowfullscreen="" loading="lazy"></iframe>
182
- </div>
 
 
 
 
 
 
 
 
 
 
183
  </div>
184
  </div>
185
  """, unsafe_allow_html=True)
186
 
 
 
 
 
 
 
 
 
 
187
  if __name__ == "__main__":
188
  main()
 
1
  import streamlit as st
2
 
3
  def main():
4
+ # Updated CSS for Contact page
5
  st.markdown("""
6
  <style>
7
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
8
+
9
+ * {
10
+ font-family: 'Inter', sans-serif !important;
11
+ box-sizing: border-box;
12
+ }
13
 
14
  .stApp {
15
+ background: #ffffff;
 
16
  min-height: 100vh;
17
+ color: #1f2a44;
18
+ margin: 0 !important;
19
+ padding: 0 !important;
20
  }
21
 
22
+ #MainMenu {visibility: hidden;}
23
  footer {visibility: hidden;}
24
  .stDeployButton {display: none;}
25
  header {visibility: hidden;}
26
  .stApp > header {visibility: hidden;}
27
 
28
+ /* Main Container */
29
+ .main-container {
30
+ max-width: 100%;
31
+ width: 100%;
32
  margin: 0 auto;
33
+ padding: 1rem 2rem;
34
  }
35
 
36
+ /* Header Section */
37
+ .header-section {
38
  text-align: center;
39
+ margin-bottom: 2.5rem;
40
+ padding: 1.5rem 0;
41
  }
42
 
43
  .header-title {
44
+ font-size: 2.25rem;
45
  font-weight: 700;
46
+ color: #1f2a44;
47
+ margin: 0;
48
+ }
49
+
50
+ .header-subtitle {
51
+ font-size: 1rem;
52
+ color: #6b7280;
53
+ font-weight: 400;
54
+ max-width: 600px;
55
+ margin: 0.5rem auto 0;
56
  }
57
 
58
+ /* Section Styling */
59
  .section {
60
+ margin-bottom: 3rem;
61
+ max-width: 1200px;
62
+ margin-left: auto;
63
+ margin-right: auto;
64
  }
65
 
66
  .section-title {
67
+ font-size: 1.75rem;
68
  font-weight: 600;
69
+ color: #1f2a44;
70
+ margin-bottom: 1rem;
 
 
 
71
  }
72
 
73
+ .section-description {
74
+ font-size: 0.95rem;
75
+ color: #6b7280;
76
+ line-height: 1.6;
77
+ text-align: center;
78
+ max-width: 700px;
79
+ margin: 0 auto 1.5rem;
80
  }
81
 
82
+ /* Contact Layout */
83
+ .contact-layout {
84
+ display: grid;
85
+ grid-template-columns: 1fr 1fr;
86
  gap: 2rem;
87
+ max-width: 1200px;
88
+ margin: 0 auto;
89
+ padding: 0 1rem;
90
  }
91
 
92
+ @media (max-width: 768px) {
93
+ .contact-layout {
94
+ grid-template-columns: 1fr;
95
+ gap: 1.5rem;
96
+ }
97
  }
98
 
99
+ /* Form Container */
100
+ .form-container {
101
+ background: #f9fafb;
102
+ padding: 2rem;
103
+ border-radius: 8px;
104
+ border: 1px solid #e5e7eb;
105
  }
106
 
107
+ .form-title {
108
+ font-size: 1.5rem;
109
+ font-weight: 600;
110
+ color: #1f2a44;
111
+ margin-bottom: 1.5rem;
112
  }
113
 
114
+ /* Form Inputs */
115
  .stTextInput > div > div > input,
116
  .stTextArea > div > div > textarea {
117
+ border-radius: 6px !important;
118
  border: 1px solid #d1d5db !important;
119
+ padding: 0.75rem 1rem !important;
120
+ font-size: 0.9rem !important;
 
121
  background: #ffffff !important;
122
+ transition: border-color 0.2s ease !important;
123
  }
124
 
125
  .stTextInput > div > div > input:focus,
126
  .stTextArea > div > div > textarea:focus {
127
+ border-color: #3b82f6 !important;
 
128
  outline: none !important;
129
  }
130
 
 
133
  color: #9ca3af !important;
134
  }
135
 
136
+ /* Submit Button */
137
  .stButton > button {
138
+ background: #3b82f6 !important;
139
  color: white !important;
140
+ border-radius: 6px !important;
141
+ padding: 0.75rem 1.5rem !important;
142
+ font-size: 0.95rem !important;
143
+ font-weight: 500 !important;
144
+ transition: background-color 0.2s ease !important;
 
145
  border: none !important;
146
  width: 100% !important;
147
  }
148
 
149
  .stButton > button:hover {
150
+ background: #2563eb !important;
 
151
  }
152
 
153
+ /* Map Container */
154
+ .map-container {
155
+ background: #f9fafb;
156
+ padding: 2rem;
157
+ border-radius: 8px;
158
+ border: 1px solid #e5e7eb;
159
+ }
160
+
161
+ .map-title {
162
+ font-size: 1.5rem;
163
+ font-weight: 600;
164
+ color: #1f2a44;
165
+ margin-bottom: 1.5rem;
166
+ }
167
+
168
+ .map-wrapper {
169
+ border-radius: 6px;
170
+ overflow: hidden;
171
+ }
172
+
173
+ .map-wrapper iframe {
174
+ width: 100%;
175
+ height: 300px;
176
+ border: none;
177
+ }
178
+
179
+ /* Contact Info Cards */
180
+ .contact-info {
181
+ display: grid;
182
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
183
+ gap: 1.5rem;
184
+ max-width: 1200px;
185
+ margin: 2.5rem auto;
186
+ padding: 0 1rem;
187
+ }
188
+
189
+ .info-card {
190
+ background: #f9fafb;
191
+ color: #1f2a44;
192
+ padding: 1.5rem;
193
+ border-radius: 8px;
194
+ text-align: center;
195
+ border: 1px solid #e5e7eb;
196
+ transition: transform 0.2s ease;
197
+ }
198
+
199
+ .info-card:hover {
200
+ transform: translateY(-3px);
201
+ }
202
+
203
+ .info-card-icon {
204
+ font-size: 1.75rem;
205
+ margin-bottom: 0.75rem;
206
+ color: #3b82f6;
207
+ }
208
+
209
+ .info-card-title {
210
+ font-size: 1.1rem;
211
+ font-weight: 500;
212
+ margin-bottom: 0.5rem;
213
+ }
214
+
215
+ .info-card-text {
216
+ font-size: 0.9rem;
217
+ color: #6b7280;
218
+ line-height: 1.4;
219
+ }
220
+
221
+ /* Footer */
222
+ .footer {
223
+ border-top: 1px solid #e5e7eb;
224
+ padding: 1.5rem 0;
225
+ text-align: center;
226
+ max-width: 1200px;
227
+ margin: 2rem auto 0;
228
+ }
229
+
230
+ /* Success/Error Messages */
231
+ .stAlert {
232
+ border-radius: 6px !important;
233
+ font-weight: 400 !important;
234
+ margin: 1rem 0;
235
  }
236
 
237
+ /* Responsive Design */
238
+ @media (max-width: 1024px) {
239
+ .main-container {
240
+ padding: 1rem;
241
+ }
242
+ .contact-layout {
243
+ padding: 0 0.5rem;
244
+ }
245
+ .contact-info {
246
+ padding: 0 0.5rem;
247
+ }
248
+ }
249
+
250
+ @media (max-width: 768px) {
251
+ .header-title {
252
+ font-size: 1.75rem;
253
+ }
254
+ .header-subtitle {
255
+ font-size: 0.9rem;
256
+ }
257
+ .section-title {
258
+ font-size: 1.5rem;
259
+ }
260
+ .form-container,
261
+ .map-container {
262
+ padding: 1.25rem;
263
+ }
264
+ .form-title,
265
+ .map-title {
266
+ font-size: 1.25rem;
267
+ }
268
+ }
269
+
270
+ @media (max-width: 480px) {
271
+ .header-title {
272
+ font-size: 1.5rem;
273
+ }
274
+ .header-subtitle {
275
+ font-size: 0.85rem;
276
+ }
277
+ .section-title {
278
+ font-size: 1.25rem;
279
+ }
280
+ .section-description {
281
+ font-size: 0.85rem;
282
+ }
283
+ .form-container,
284
+ .map-container {
285
+ padding: 1rem;
286
+ }
287
+ .contact-info {
288
+ gap: 1rem;
289
+ }
290
  }
291
  </style>
292
  """, unsafe_allow_html=True)
293
 
294
+ # Main Container
295
+ st.markdown('<div class="main-container">', unsafe_allow_html=True)
296
+
297
+ # Header Section
298
+ st.markdown("""
299
+ <div class="header-section">
300
+ <h1 class="header-title">πŸ“‹ TruthCheck</h1>
301
+ <p class="header-subtitle">Reach out for inquiries, feedback, or support</p>
302
+ </div>
303
+ """, unsafe_allow_html=True)
304
 
305
+ # Get in Touch Section
 
306
  st.markdown("""
307
+ <div class="section">
308
+ <h2 class="section-title">Get in Touch</h2>
309
+ <p class="section-description">
310
+ Have questions or need assistance? Use the form below or our contact details to connect with us.
311
+ </p>
312
  </div>
313
  """, unsafe_allow_html=True)
314
 
315
+ # Contact Layout
316
+ st.markdown('<div class="contact-layout">', unsafe_allow_html=True)
317
+
318
+ # Contact Form Column
319
  st.markdown("""
320
+ <div class="form-container">
321
+ <h3 class="form-title">Send a Message</h3>
 
 
 
 
 
 
 
 
322
  """, unsafe_allow_html=True)
323
 
324
  # Contact Form
325
+ with st.form(key="contact_form", clear_on_submit=True):
326
+ col1, col2 = st.columns([1, 1])
327
+
328
+ with col1:
329
+ name = st.text_input("Full Name", placeholder="Your full name")
330
+ with col2:
331
+ email = st.text_input("Email", placeholder="Your email address")
332
+
333
+ subject = st.text_input("Subject", placeholder="What's your inquiry about?")
334
+ message = st.text_area("Message", placeholder="Your message here...", height=100)
335
+
336
  submit_button = st.form_submit_button("Send Message")
337
 
338
  if submit_button:
339
+ if name and email and subject and message:
340
+ st.success("Thank you! Your message has been sent. We'll respond within 24 hours.")
341
  else:
342
+ st.error("Please complete all fields before submitting.")
343
 
344
+ st.markdown('</div>', unsafe_allow_html=True)
345
+
346
+ # Map Container Column
347
+ st.markdown("""
348
+ <div class="map-container">
349
+ <h3 class="map-title">Our Location</h3>
350
+ <div class="map-wrapper">
351
+ <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3432.728046226142!2d73.14653207528688!3d30.641621074628397!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3922b6e4dde0c501%3A0xc37ea3d85326203!2sCOMSATS%20University%20Islamabad%20-%20Sahiwal%20Campus!5e0!3m2!1sen!2s!4v1753523148476!5m2!1sen!2s" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
352
+ </div>
353
+ </div>
354
+ """, unsafe_allow_html=True)
355
+
356
+ st.markdown('</div>', unsafe_allow_html=True) # Close contact-layout
357
+
358
+ # Contact Information Cards
359
  st.markdown("""
360
+ <div class="contact-info">
361
+ <div class="info-card">
362
+ <div class="info-card-icon">πŸ“§</div>
363
+ <div class="info-card-title">Email</div>
364
+ <div class="info-card-text">[email protected]<br>[email protected]</div>
365
+ </div>
366
+ <div class="info-card">
367
+ <div class="info-card-icon">πŸ“ž</div>
368
+ <div class="info-card-title">Phone</div>
369
+ <div class="info-card-text">+92309-1111977<br>+92336-6569117<br>Mon-Fri 9AM-5PM</div>
370
+ </div>
371
+ <div class="info-card">
372
+ <div class="info-card-icon">πŸ“</div>
373
+ <div class="info-card-title">Address</div>
374
+ <div class="info-card-text">COMSATS University Islamabad<br>Sahiwal Campus</div>
375
  </div>
376
  </div>
377
  """, unsafe_allow_html=True)
378
 
379
+ # Footer
380
+ st.markdown("---")
381
+ st.markdown(
382
+ '<p style="text-align: center; font-weight: 600; font-size: 16px;">πŸ’» Developed with ❀️ using Streamlit | Β© 2025</p>',
383
+ unsafe_allow_html=True
384
+ )
385
+
386
+ st.markdown('</div>', unsafe_allow_html=True) # Close main-container
387
+
388
  if __name__ == "__main__":
389
  main()