Spaces:
Running
Running
Create contact.py
#10
by
KhaqanNasir
- opened
- src/contact.py +83 -0
src/contact.py
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
# Apply Poppins font across the app
|
| 14 |
+
st.markdown("""
|
| 15 |
+
<style>
|
| 16 |
+
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');
|
| 17 |
+
html, body, [class*="css"], * {
|
| 18 |
+
font-family: 'Poppins', sans-serif;
|
| 19 |
+
}
|
| 20 |
+
</style>
|
| 21 |
+
""", unsafe_allow_html=True)
|
| 22 |
+
|
| 23 |
+
# Include Font Awesome CDN for icons
|
| 24 |
+
st.markdown("""
|
| 25 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
|
| 26 |
+
""", unsafe_allow_html=True)
|
| 27 |
+
|
| 28 |
+
# Title Section
|
| 29 |
+
st.markdown("<h1 style='font-size: 60px; text-align: center;'>Contact Us</h1>", unsafe_allow_html=True)
|
| 30 |
+
st.markdown("<p style='font-size: 20px; text-align: center; color: gray;'>We'd love to hear from you! Reach out with any questions or feedback.</p>", unsafe_allow_html=True)
|
| 31 |
+
|
| 32 |
+
# Contact Form
|
| 33 |
+
st.markdown("<h2 style='font-size: 30px;'>📬 Get in Touch</h2>", unsafe_allow_html=True)
|
| 34 |
+
st.write("Fill in the form below to contact us directly!")
|
| 35 |
+
|
| 36 |
+
contact_form = st.form(key='contact_form')
|
| 37 |
+
name = contact_form.text_input("Your Name")
|
| 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 |
+
if submit_button:
|
| 43 |
+
if name and email and message:
|
| 44 |
+
st.success("Thank you for reaching out! We will get back to you soon.")
|
| 45 |
+
else:
|
| 46 |
+
st.error("Please fill in all the fields.")
|
| 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 |
+
<div style='width: 100%; height: 100%;'>
|
| 54 |
+
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3426.9461831002777!2d73.43206937626101!3d30.80414347455002!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3922a73c3c264d03%3A0x1654eeba796b65a3!2sMohammad%20Ali%20Jinnah%20Rd%2C%20Okara%2C%20Punjab%2C%20Pakistan!5e0!3m2!1sen!2s!4v1733648554209!5m2!1sen!2s"
|
| 55 |
+
width="100%" height="600" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
|
| 56 |
+
</div>""", unsafe_allow_html=True)
|
| 57 |
+
|
| 58 |
+
# Social Media Section
|
| 59 |
+
st.markdown("<h2 style='font-size: 30px;'>💬 Follow Us</h2>", unsafe_allow_html=True)
|
| 60 |
+
st.write("Stay connected with us through social media:")
|
| 61 |
+
social_media_links = {
|
| 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()
|