Spaces:
Sleeping
Sleeping
LearnwithShashank commited on
Commit ·
ba2a24e
1
Parent(s): 83e79f3
1234567816 unmodified lines25262726282930313233343536373839404142433844454640414748import streamlit as stimport urllib.parse
st.set_page_config(page_title="Gen Z vs Millennial Quiz", page_icon="🤖", layout="centered")
st.title("✨ How Gen Z / Millennial Are You?")st.markdown("Answer these fun questions to find out your vibe!")
16 unmodified lines
for i, (q, opts, points) in enumerate(questions): st.subheader(f"Q{i+1}. {q}") choice = st.radio("", opts, key=i) choice = st.radio("Choose an option", opts, key=i, label_visibility="collapsed") score += points[opts.index(choice)]
if st.button("🔍 Reveal My Result"): st.markdown("---") if score >= 22: st.success("🎉 You're Pure Gen Z! 💅 You speak in memes, fear nothing, and run on iced coffee.") st.markdown('<img src="https://media.giphy.com/media/ASd0Ukj0y3qMM/giphy.gif" width="250">', unsafe_allow_html=True) elif 14 <= score < 22: st.info("😎 You’re a Chill Millennial-Z Hybrid! You love both avocado toast and TikToks.") st.markdown('<img src="https://media.giphy.com/media/l0Exk8EUzSLsrErEQ/giphy.gif" width="250">', unsafe_allow_html=True) else: st.warning("📞 You’re More Millennial Vibes – Emo songs, Facebook memories, and semi-adulting life.") st.markdown('<img src="https://media.giphy.com/media/l0MYC0LajbaPoEADu/giphy.gif" width="250">', unsafe_allow_html=True)
# Share st.markdown("Share your result:") st.markdown("### Share your result:") share_text = "I just took the Gen Z vs Millennial quiz! Find out your vibe here: https://ai.flexingdata.com" encoded_text = urllib.parse.quote(share_text) whatsapp_url = f"https://wa.me/?text={share_text.replace(' ', '%20')}" st.markdown(f"[📲 Share on WhatsApp]({whatsapp_url})") whatsapp_url = f"https://wa.me/?text={encoded_text}" st.markdown(f"[📲 Share on WhatsApp]({whatsapp_url})", unsafe_allow_html=True)app.py+11-4