Spaces:
Sleeping
Sleeping
Update src/contact.py (#31)
Browse files- Update src/contact.py (3c12889952a80b13724dbe80df63b2a17818e248)
Co-authored-by: Muhammad Khaqan Nasir <[email protected]>
- src/contact.py +170 -65
src/contact.py
CHANGED
@@ -1,83 +1,188 @@
|
|
1 |
import streamlit as st
|
2 |
|
3 |
-
# Set page configuration
|
4 |
-
st.set_page_config(
|
5 |
-
page_title="Contact Us | AI News Generator",
|
6 |
-
page_icon="π",
|
7 |
-
layout="wide",
|
8 |
-
initial_sidebar_state="collapsed"
|
9 |
-
)
|
10 |
-
|
11 |
-
# Main Function
|
12 |
def main():
|
13 |
-
#
|
14 |
st.markdown("""
|
15 |
<style>
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
</style>
|
21 |
""", unsafe_allow_html=True)
|
22 |
|
23 |
-
|
|
|
|
|
24 |
st.markdown("""
|
25 |
-
<
|
|
|
|
|
|
|
|
|
26 |
""", unsafe_allow_html=True)
|
27 |
|
28 |
-
#
|
29 |
-
st.markdown("
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
# Contact Form
|
33 |
-
st.
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
email = contact_form.text_input("Your Email")
|
39 |
-
message = contact_form.text_area("Your Message")
|
40 |
-
submit_button = contact_form.form_submit_button("Send Message")
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
# Contact Information Section
|
49 |
-
st.markdown("<h2 style='font-size: 30px;'>π Our Location</h2>", unsafe_allow_html=True)
|
50 |
-
st.write("Find us at our office location:")
|
51 |
|
52 |
st.markdown("""
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
"GitHub": "https://github.com/yourprofile",
|
63 |
-
"LinkedIn": "https://www.linkedin.com/in/yourprofile",
|
64 |
-
"Twitter": "https://twitter.com/yourprofile"
|
65 |
-
}
|
66 |
-
|
67 |
-
for platform, link in social_media_links.items():
|
68 |
-
st.markdown(f"""
|
69 |
-
<a href='{link}' target='_blank' style='font-size: 20px; color: #0077B5; margin-right: 20px;'>
|
70 |
-
<i class="fab fa-{platform.lower()}" style="font-size: 24px;"></i> {platform}
|
71 |
-
</a>
|
72 |
-
""", unsafe_allow_html=True)
|
73 |
-
|
74 |
-
# Footer
|
75 |
-
st.markdown("---")
|
76 |
-
st.markdown(
|
77 |
-
'<p style="text-align: center; font-weight: 600; font-size: 16px;">π» Developed with β€οΈ using Streamlit | Β© 2024</p>',
|
78 |
-
unsafe_allow_html=True
|
79 |
-
)
|
80 |
-
|
81 |
-
# Run the app
|
82 |
if __name__ == "__main__":
|
83 |
main()
|
|
|
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 |
+
|
105 |
+
.stTextInput > div > div > input::placeholder,
|
106 |
+
.stTextArea > div > div > textarea::placeholder {
|
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()
|