Spaces:
Sleeping
Sleeping
import streamlit as st | |
# Setting a custom CSS style | |
st.markdown( | |
""" | |
<style> | |
.css-18e3th9 { | |
padding-top: 20px; | |
padding-bottom: 20px; | |
padding-left: 40px; | |
padding-right: 40px; | |
} | |
h1 { | |
text-align: center; | |
color: #4CAF50; | |
} | |
.form-section { | |
padding: 20px; | |
background-color: #f9f9f9; | |
border-radius: 10px; | |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | |
} | |
.submitted { | |
color: #4CAF50; | |
font-weight: bold; | |
text-align: center; | |
} | |
</style> | |
""", | |
unsafe_allow_html=True, | |
) | |
# Displaying the header image of a Muslim couple from the correct local path | |
st.image( | |
"shadi.jpg", # Path to your local image | |
caption="Welcome to Muslim Matrimony", | |
use_column_width=True, | |
) | |
# Form fields | |
st.title("Register for Muslim Matrimony") | |
with st.form("matrimony_form"): | |
st.markdown('<div class="form-section">', unsafe_allow_html=True) | |
name = st.text_input("Your Name", max_chars=50) | |
city = st.selectbox( | |
"City", | |
["None","Hyderabad", "Chennai", "Delhi", "Bombay", "Pune", "Ajmer", "Lucknow"], | |
) | |
profession = st.selectbox( | |
"Profession", ["None", "Engineer", "Doctor", "Chartered Accountant", "Businessman"] | |
) | |
age = st.number_input("Age", min_value=18, max_value=100, step=1) | |
gender = st.radio("Gender", ["Male", "Female"]) | |
qualification = st.text_input("Qualification (Leave blank if none)") | |
sect = st.radio("Sect", ["Sunni", "Shia"]) | |
st.markdown('</div>', unsafe_allow_html=True) | |
submitted = st.form_submit_button("Submit") | |
if submitted: | |
# Welcome message with entered details | |
st.markdown( | |
'<div class="submitted"><h3>Welcome!</h3></div>', unsafe_allow_html=True | |
) | |
st.write(f"Hello, {name}!") | |
st.write(f"You are a **{gender}** of **{sect}** sect.") | |
st.write(f"Profession: **{profession}**") | |
st.write(f"Age: **{age}**") | |
st.write(f"City: **{city}**") | |
if qualification: | |
st.write(f"Qualification: **{qualification}**") | |
# Display balloons | |
st.balloons() | |