import streamlit as st import random from datetime import datetime st.set_page_config( page_title="SoulCompass - Find Your Inner North Star", page_icon="🧭", layout="wide" ) # 初始化 if 'daily_usage' not in st.session_state: st.session_state.daily_usage = 0 # į°ĄåŒ–åĄ”įž…į‰Œ tarot_cards = [ "The Fool - New beginnings and fresh starts", "The Magician - Power to manifest your dreams", "The High Priestess - Trust your intuition", "The Empress - Creativity and abundance", "The Emperor - Structure and authority", "The Lovers - Love and important choices", "The Chariot - Victory through determination", "Strength - Inner courage and compassion", "The Hermit - Soul searching and wisdom", "Wheel of Fortune - Life cycles and destiny", "Justice - Balance and fairness", "The Hanged Man - New perspective needed", "Death - Transformation and renewal", "Temperance - Patience and moderation", "The Devil - Breaking free from limitations", "The Tower - Sudden change and awakening", "The Star - Hope and inspiration", "The Moon - Dreams and subconscious", "The Sun - Joy and success", "Judgement - Spiritual awakening", "The World - Completion and achievement" ] # CSS st.markdown(""" """, unsafe_allow_html=True) # ä¸ģæ¨™éĄŒ st.markdown("""

🧭 SoulCompass

Find Your Inner North Star

🔮 Tarot Reading | đŸ”ĸ Numerology | 📖 Soul Journal | 🤖 AI Therapist

⭐ 15,247 users đŸ’¯ 4.9/5 rating
""", unsafe_allow_html=True) # 削餘æŦĄæ•¸ remaining = 5 - st.session_state.daily_usage st.markdown(f"""
đŸŽĢ Daily Free Readings: {remaining}/5
""", unsafe_allow_html=True) # ä¸ģčρ功čƒŊå€åĄŠ tab1, tab2, tab3, tab4 = st.tabs(["🔮 Tarot Reading", "đŸ”ĸ Numerology", "📖 Soul Journal", "🤖 AI Therapist"]) # 🔮 Tarot with tab1: st.header("🔮 Tarot Reading") st.write("*Let ancient wisdom guide your path*") question = st.text_area( "What would you like guidance on?", placeholder="Example: I'm facing a difficult decision at work...", height=100 ) if question: spread = st.selectbox( "Choose your reading type", ["Single Card - Quick Guidance", "Three Cards - Past Present Future", "Five Cards - Deep Insight"] ) if st.button("🔮 Draw Cards", type="primary"): if st.session_state.daily_usage >= 5: st.error("😔 Daily limit reached! Come back tomorrow") else: st.session_state.daily_usage += 1 with st.spinner("✨ Drawing your cards..."): import time time.sleep(2) num_cards = 1 if "Single" in spread else (3 if "Three" in spread else 5) drawn = random.sample(tarot_cards, num_cards) st.success("🌟 Your reading is complete!") for i, card in enumerate(drawn): st.markdown(f"""

Card {i+1}

{card}

""", unsafe_allow_html=True) # 最įĩ‚č§ŖčŽ€ reading = f""" 🔮 **Your SoulCompass Reading** **Question:** {question} **Cards Drawn:** {len(drawn)} cards **Interpretation:** The cards reveal important insights about your situation. The first card shows your current energy, while the others provide guidance for moving forward. **Key Message:** Trust your inner wisdom and stay open to new possibilities. The universe is supporting your journey. **Readings used today:** {st.session_state.daily_usage}/5 """ st.markdown(f"""
{reading.replace(chr(10), '
')}
""", unsafe_allow_html=True) # đŸ”ĸ Numerology with tab2: st.header("đŸ”ĸ Numerology") st.write("*Discover your numbers*") col1, col2 = st.columns(2) with col1: st.subheader("Life Path Number") birth_date = st.date_input("Your birth date") if birth_date and st.button("Calculate"): date_str = birth_date.strftime('%Y%m%d') total = sum(int(d) for d in date_str) while total > 9: total = sum(int(d) for d in str(total)) meanings = { 1: "Leader - Independent and pioneering", 2: "Peacemaker - Cooperative and diplomatic", 3: "Creative - Expressive and optimistic", 4: "Builder - Practical and hardworking", 5: "Explorer - Freedom-loving and adventurous", 6: "Nurturer - Caring and responsible", 7: "Seeker - Analytical and spiritual", 8: "Achiever - Ambitious and organized", 9: "Humanitarian - Compassionate and wise" } st.success(f"Your Life Path Number: **{total}**") st.info(meanings.get(total, "Special number with unique meaning")) with col2: st.subheader("Name Number") name = st.text_input("Your full name") if name and st.button("Analyze Name"): name_num = len(name) % 9 + 1 st.success(f"Your Name Number: **{name_num}**") st.info("This number influences how others see you") # 📖 Soul Journal with tab3: st.header("📖 Soul Journal") st.write("*Record your inner journey*") mood = st.slider("Today's mood (1-10)", 1, 10, 7) emotion = st.selectbox("Main emotion", ["😊 Happy", "😔 Sad", "😰 Worried", "😌 Calm", "🤗 Grateful"]) entry = st.text_area( "Write your thoughts", placeholder="How are you feeling today? What's on your mind?", height=120 ) if st.button("💾 Save Entry"): if entry: st.success("✅ Your journal entry has been saved!") st.balloons() else: st.warning("Please write something first") # 🤖 AI Therapist with tab4: st.header("🤖 AI Therapist") st.write("*Your 24/7 companion*") st.markdown("""
🤖

SoulCompass AI Guide

Here to listen and support you

""", unsafe_allow_html=True) topic = st.selectbox( "What would you like to talk about?", ["General Support", "Stress & Anxiety", "Relationships", "Life Goals", "Personal Growth"] ) message = st.text_area( "Share your thoughts", placeholder="Tell me what's on your mind...", height=100 ) if message and st.button("đŸ’Ģ Get Support"): with st.spinner("🤖 Thinking..."): import time time.sleep(1) responses = [ f"Thank you for sharing about {topic.lower()}. I hear that you're saying: '{message}'. Your feelings are completely valid, and it's brave of you to reach out.", f"I understand you're dealing with {topic.lower()}. What you've shared - '{message}' - shows real self-awareness. You're taking positive steps by talking about it.", f"Regarding {topic.lower()}, I want you to know that '{message}' resonates with me. Remember, you have inner strength and wisdom to navigate this." ] response = random.choice(responses) st.markdown(f"""
You: {message}
🤖 AI Guide: {response}

💙 I'm here to support you. For serious concerns, please reach out to a professional.
""", unsafe_allow_html=True) # 頁腺 st.markdown("---") st.markdown("""

🧭 SoulCompass - Find Your Inner North Star

Made with â¤ī¸ for spiritual seekers worldwide

💎 Upgrade to Pro | 📧 support@soulcompass.ai | 🌐 soulcompass.ai

""", unsafe_allow_html=True)