Spaces:
Running
Running
Update src/contact.py
Browse files- src/contact.py +294 -93
src/contact.py
CHANGED
@@ -1,104 +1,130 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
def main():
|
4 |
-
#
|
5 |
st.markdown("""
|
6 |
<style>
|
7 |
-
@import url('https://fonts.googleapis.com/css2?family=
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
.stApp {
|
10 |
-
|
11 |
-
background: #f8fafc;
|
12 |
min-height: 100vh;
|
13 |
-
color: #
|
|
|
|
|
14 |
}
|
15 |
|
16 |
-
#MainMenu {visibility:
|
17 |
footer {visibility: hidden;}
|
18 |
.stDeployButton {display: none;}
|
19 |
header {visibility: hidden;}
|
20 |
.stApp > header {visibility: hidden;}
|
21 |
|
22 |
-
|
23 |
-
|
|
|
|
|
24 |
margin: 0 auto;
|
25 |
-
padding:
|
26 |
}
|
27 |
|
28 |
-
|
29 |
-
|
30 |
text-align: center;
|
|
|
|
|
31 |
}
|
32 |
|
33 |
.header-title {
|
34 |
-
font-size: 2.
|
35 |
font-weight: 700;
|
36 |
-
color: #
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
|
|
42 |
.section {
|
43 |
-
margin-bottom:
|
|
|
|
|
|
|
44 |
}
|
45 |
|
46 |
.section-title {
|
47 |
-
font-size:
|
48 |
font-weight: 600;
|
49 |
-
color: #
|
50 |
-
margin-bottom:
|
51 |
-
display: flex;
|
52 |
-
align-items: center;
|
53 |
-
gap: 0.5rem;
|
54 |
}
|
55 |
|
56 |
-
.section-
|
57 |
-
font-size:
|
58 |
-
color: #
|
59 |
-
line-height: 1.
|
60 |
-
|
61 |
-
|
|
|
62 |
}
|
63 |
|
64 |
-
|
65 |
-
|
|
|
|
|
66 |
gap: 2rem;
|
67 |
-
|
|
|
|
|
68 |
}
|
69 |
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
73 |
}
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
-
.
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
}
|
86 |
|
|
|
87 |
.stTextInput > div > div > input,
|
88 |
.stTextArea > div > div > textarea {
|
89 |
-
border-radius:
|
90 |
border: 1px solid #d1d5db !important;
|
91 |
-
padding: 1rem !important;
|
92 |
-
font-size:
|
93 |
-
font-family: 'Poppins', sans-serif !important;
|
94 |
background: #ffffff !important;
|
95 |
-
transition:
|
96 |
}
|
97 |
|
98 |
.stTextInput > div > div > input:focus,
|
99 |
.stTextArea > div > div > textarea:focus {
|
100 |
-
border-color: #
|
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: #
|
112 |
color: white !important;
|
113 |
-
border-radius:
|
114 |
-
padding: 0.75rem
|
115 |
-
font-size:
|
116 |
-
font-weight:
|
117 |
-
|
118 |
-
transition: all 0.2s ease !important;
|
119 |
border: none !important;
|
120 |
width: 100% !important;
|
121 |
}
|
122 |
|
123 |
.stButton > button:hover {
|
124 |
-
background: #
|
125 |
-
transform: translateY(-1px) !important;
|
126 |
}
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
}
|
132 |
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
}
|
136 |
</style>
|
137 |
""", unsafe_allow_html=True)
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
-
|
141 |
-
# Header
|
142 |
st.markdown("""
|
143 |
-
<div class="
|
144 |
-
<
|
145 |
-
|
146 |
-
|
|
|
147 |
</div>
|
148 |
""", unsafe_allow_html=True)
|
149 |
|
150 |
-
# Contact
|
|
|
|
|
|
|
151 |
st.markdown("""
|
152 |
-
<div class="container">
|
153 |
-
<
|
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 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
174 |
else:
|
175 |
-
st.error("Please
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
st.markdown("""
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
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()
|