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 |
+
page_title=โSoulCompass - Find Your Inner North Starโ,
|
| 7 |
+
page_icon=โ๐งญโ,
|
| 8 |
+
layout=โwideโ
|
| 9 |
+
)
|
| 10 |
+
|
| 11 |
+
# ๅๅงๅ
|
| 12 |
+
|
| 13 |
+
if โdaily_usageโ not in st.session_state:
|
| 14 |
+
st.session_state.daily_usage = 0
|
| 15 |
+
|
| 16 |
+
# ็ฐกๅๅก็พ
็
|
| 17 |
+
|
| 18 |
+
tarot_cards = [
|
| 19 |
+
โThe Fool - New beginnings and fresh startsโ,
|
| 20 |
+
โThe Magician - Power to manifest your dreamsโ,
|
| 21 |
+
โThe High Priestess - Trust your intuitionโ,
|
| 22 |
+
โThe Empress - Creativity and abundanceโ,
|
| 23 |
+
โThe Emperor - Structure and authorityโ,
|
| 24 |
+
โThe Lovers - Love and important choicesโ,
|
| 25 |
+
โThe Chariot - Victory through determinationโ,
|
| 26 |
+
โStrength - Inner courage and compassionโ,
|
| 27 |
+
โThe Hermit - Soul searching and wisdomโ,
|
| 28 |
+
โWheel of Fortune - Life cycles and destinyโ,
|
| 29 |
+
โJustice - Balance and fairnessโ,
|
| 30 |
+
โThe Hanged Man - New perspective neededโ,
|
| 31 |
+
โDeath - Transformation and renewalโ,
|
| 32 |
+
โTemperance - Patience and moderationโ,
|
| 33 |
+
โThe Devil - Breaking free from limitationsโ,
|
| 34 |
+
โThe Tower - Sudden change and awakeningโ,
|
| 35 |
+
โThe Star - Hope and inspirationโ,
|
| 36 |
+
โThe Moon - Dreams and subconsciousโ,
|
| 37 |
+
โThe Sun - Joy and successโ,
|
| 38 |
+
โJudgement - Spiritual awakeningโ,
|
| 39 |
+
โThe World - Completion and achievementโ
|
| 40 |
+
]
|
| 41 |
+
|
| 42 |
+
# CSS
|
| 43 |
+
|
| 44 |
+
st.markdown(โโโ
|
| 45 |
+
|
| 46 |
+
<style>
|
| 47 |
+
.header {
|
| 48 |
+
text-align: center;
|
| 49 |
+
background: linear-gradient(135deg, #6366F1, #C084FC);
|
| 50 |
+
color: white;
|
| 51 |
+
padding: 3rem;
|
| 52 |
+
border-radius: 20px;
|
| 53 |
+
margin-bottom: 2rem;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.card {
|
| 57 |
+
background: linear-gradient(135deg, #1E3A8A, #6366F1);
|
| 58 |
+
color: white;
|
| 59 |
+
padding: 2rem;
|
| 60 |
+
border-radius: 15px;
|
| 61 |
+
margin: 1rem;
|
| 62 |
+
text-align: center;
|
| 63 |
+
border: 2px solid #F59E0B;
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
.result {
|
| 67 |
+
background: linear-gradient(135deg, #6366F1, #C084FC);
|
| 68 |
+
color: white;
|
| 69 |
+
padding: 2rem;
|
| 70 |
+
border-radius: 15px;
|
| 71 |
+
margin: 2rem 0;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.quota {
|
| 75 |
+
background: linear-gradient(135deg, #F59E0B, #FB923C);
|
| 76 |
+
color: white;
|
| 77 |
+
padding: 1rem 2rem;
|
| 78 |
+
border-radius: 50px;
|
| 79 |
+
text-align: center;
|
| 80 |
+
font-weight: bold;
|
| 81 |
+
margin: 2rem auto;
|
| 82 |
+
max-width: 400px;
|
| 83 |
+
}
|
| 84 |
+
</style>
|
| 85 |
+
|
| 86 |
+
โโโ, unsafe_allow_html=True)
|
| 87 |
+
|
| 88 |
+
# ไธปๆจ้ก
|
| 89 |
+
|
| 90 |
+
st.markdown(โโโ
|
| 91 |
+
|
| 92 |
+
<div class="header">
|
| 93 |
+
<h1>๐งญ SoulCompass</h1>
|
| 94 |
+
<h2>Find Your Inner North Star</h2>
|
| 95 |
+
<p>๐ฎ Tarot Reading | ๐ข Numerology | ๐ Soul Journal | ๐ค AI Therapist</p>
|
| 96 |
+
<div style="margin-top: 20px;">
|
| 97 |
+
<span style="background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 20px; margin: 10px;">
|
| 98 |
+
โญ 15,247 users
|
| 99 |
+
</span>
|
| 100 |
+
<span style="background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 20px; margin: 10px;">
|
| 101 |
+
๐ฏ 4.9/5 rating
|
| 102 |
+
</span>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
""", unsafe_allow_html=True)
|
| 106 |
+
|
| 107 |
+
# ๅฉ้คๆฌกๆธ
|
| 108 |
+
|
| 109 |
+
remaining = 5 - st.session_state.daily_usage
|
| 110 |
+
st.markdown(fโโโ
|
| 111 |
+
|
| 112 |
+
<div class="quota">
|
| 113 |
+
๐ซ Daily Free Readings: {remaining}/5
|
| 114 |
+
</div>
|
| 115 |
+
""", unsafe_allow_html=True)
|
| 116 |
+
|
| 117 |
+
# ไธป่ฆๅ่ฝ
|
| 118 |
+
|
| 119 |
+
tab1, tab2, tab3, tab4 = st.tabs([โ๐ฎ Tarot Readingโ, โ๐ข Numerologyโ, โ๐ Soul Journalโ, โ๐ค AI Therapistโ])
|
| 120 |
+
|
| 121 |
+
with tab1:
|
| 122 |
+
st.header(โ๐ฎ Tarot Readingโ)
|
| 123 |
+
st.write(โ*Let ancient wisdom guide your path*โ)
|
| 124 |
+
|
| 125 |
+
```
|
| 126 |
+
question = st.text_area(
|
| 127 |
+
"What would you like guidance on?",
|
| 128 |
+
placeholder="Example: I'm facing a difficult decision at work...",
|
| 129 |
+
height=100
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
if question:
|
| 133 |
+
spread = st.selectbox(
|
| 134 |
+
"Choose your reading type",
|
| 135 |
+
["Single Card - Quick Guidance", "Three Cards - Past Present Future", "Five Cards - Deep Insight"]
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
if st.button("๐ฎ Draw Cards", type="primary"):
|
| 139 |
+
if st.session_state.daily_usage >= 5:
|
| 140 |
+
st.error("๐ Daily limit reached! Come back tomorrow")
|
| 141 |
+
else:
|
| 142 |
+
st.session_state.daily_usage += 1
|
| 143 |
+
|
| 144 |
+
with st.spinner("โจ Drawing your cards..."):
|
| 145 |
+
import time
|
| 146 |
+
time.sleep(2)
|
| 147 |
+
|
| 148 |
+
num_cards = 1 if "Single" in spread else (3 if "Three" in spread else 5)
|
| 149 |
+
drawn = random.sample(tarot_cards, num_cards)
|
| 150 |
+
|
| 151 |
+
st.success("๐ Your reading is complete!")
|
| 152 |
+
|
| 153 |
+
# Show cards
|
| 154 |
+
for i, card in enumerate(drawn):
|
| 155 |
+
st.markdown(f"""
|
| 156 |
+
<div class="card">
|
| 157 |
+
<h3>Card {i+1}</h3>
|
| 158 |
+
<p>{card}</p>
|
| 159 |
+
</div>
|
| 160 |
+
""", unsafe_allow_html=True)
|
| 161 |
+
|
| 162 |
+
# Reading
|
| 163 |
+
reading = f"""
|
| 164 |
+
```
|
| 165 |
+
|
| 166 |
+
๐ฎ **Your SoulCompass Reading**
|
| 167 |
+
|
| 168 |
+
**Question:** {question}
|
| 169 |
+
|
| 170 |
+
**Cards Drawn:** {len(drawn)} cards
|
| 171 |
+
|
| 172 |
+
**Interpretation:**
|
| 173 |
+
The cards reveal important insights about your situation. The first card shows your current energy, while the others provide guidance for moving forward.
|
| 174 |
+
|
| 175 |
+
**Key Message:** Trust your inner wisdom and stay open to new possibilities. The universe is supporting your journey.
|
| 176 |
+
|
| 177 |
+
**Readings used today:** {st.session_state.daily_usage}/5
|
| 178 |
+
โโโ
|
| 179 |
+
|
| 180 |
+
```
|
| 181 |
+
st.markdown(f"""
|
| 182 |
+
<div class="result">
|
| 183 |
+
{reading.replace(chr(10), '<br>')}
|
| 184 |
+
</div>
|
| 185 |
+
""", unsafe_allow_html=True)
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
with tab2:
|
| 189 |
+
st.header(โ๐ข Numerologyโ)
|
| 190 |
+
st.write(โ*Discover your numbers*โ)
|
| 191 |
+
|
| 192 |
+
```
|
| 193 |
+
col1, col2 = st.columns(2)
|
| 194 |
+
|
| 195 |
+
with col1:
|
| 196 |
+
st.subheader("Life Path Number")
|
| 197 |
+
birth_date = st.date_input("Your birth date")
|
| 198 |
+
|
| 199 |
+
if birth_date and st.button("Calculate"):
|
| 200 |
+
date_str = birth_date.strftime('%Y%m%d')
|
| 201 |
+
total = sum(int(d) for d in date_str)
|
| 202 |
+
while total > 9:
|
| 203 |
+
total = sum(int(d) for d in str(total))
|
| 204 |
+
|
| 205 |
+
meanings = {
|
| 206 |
+
1: "Leader - Independent and pioneering",
|
| 207 |
+
2: "Peacemaker - Cooperative and diplomatic",
|
| 208 |
+
3: "Creative - Expressive and optimistic",
|
| 209 |
+
4: "Builder - Practical and hardworking",
|
| 210 |
+
5: "Explorer - Freedom-loving and adventurous",
|
| 211 |
+
6: "Nurturer - Caring and responsible",
|
| 212 |
+
7: "Seeker - Analytical and spiritual",
|
| 213 |
+
8: "Achiever - Ambitious and organized",
|
| 214 |
+
9: "Humanitarian - Compassionate and wise"
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
st.success(f"Your Life Path Number: **{total}**")
|
| 218 |
+
st.info(meanings.get(total, "Special number with unique meaning"))
|
| 219 |
+
|
| 220 |
+
with col2:
|
| 221 |
+
st.subheader("Name Number")
|
| 222 |
+
name = st.text_input("Your full name")
|
| 223 |
+
|
| 224 |
+
if name and st.button("Analyze Name"):
|
| 225 |
+
name_num = len(name) % 9 + 1
|
| 226 |
+
st.success(f"Your Name Number: **{name_num}**")
|
| 227 |
+
st.info("This number influences how others see you")
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
with tab3:
|
| 231 |
+
st.header(โ๐ Soul Journalโ)
|
| 232 |
+
st.write(โ*Record your inner journey*โ)
|
| 233 |
+
|
| 234 |
+
```
|
| 235 |
+
mood = st.slider("Today's mood (1-10)", 1, 10, 7)
|
| 236 |
+
emotion = st.selectbox("Main emotion", ["๐ Happy", "๐ Sad", "๐ฐ Worried", "๐ Calm", "๐ค Grateful"])
|
| 237 |
+
|
| 238 |
+
entry = st.text_area(
|
| 239 |
+
"Write your thoughts",
|
| 240 |
+
placeholder="How are you feeling today? What's on your mind?",
|
| 241 |
+
height=120
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
if st.button("๐พ Save Entry"):
|
| 245 |
+
if entry:
|
| 246 |
+
st.success("โ
Your journal entry has been saved!")
|
| 247 |
+
st.balloons()
|
| 248 |
+
else:
|
| 249 |
+
st.warning("Please write something first")
|
| 250 |
+
```
|
| 251 |
+
|
| 252 |
+
with tab4:
|
| 253 |
+
st.header(โ๐ค AI Therapistโ)
|
| 254 |
+
st.write(โ*Your 24/7 companion*โ)
|
| 255 |
+
|
| 256 |
+
```
|
| 257 |
+
st.markdown("""
|
| 258 |
+
<div style="background: #F3F4F6; padding: 20px; border-radius: 15px; margin: 20px 0;">
|
| 259 |
+
<div style="display: flex; align-items: center;">
|
| 260 |
+
<div style="font-size: 3rem; margin-right: 15px;">๐ค</div>
|
| 261 |
+
<div>
|
| 262 |
+
<h4 style="margin: 0; color: #6366F1;">SoulCompass AI Guide</h4>
|
| 263 |
+
<p style="margin: 5px 0; color: #6B7280;">Here to listen and support you</p>
|
| 264 |
+
</div>
|
| 265 |
+
</div>
|
| 266 |
+
</div>
|
| 267 |
+
""", unsafe_allow_html=True)
|
| 268 |
+
|
| 269 |
+
topic = st.selectbox(
|
| 270 |
+
"What would you like to talk about?",
|
| 271 |
+
["General Support", "Stress & Anxiety", "Relationships", "Life Goals", "Personal Growth"]
|
| 272 |
+
)
|
| 273 |
+
|
| 274 |
+
message = st.text_area(
|
| 275 |
+
"Share your thoughts",
|
| 276 |
+
placeholder="Tell me what's on your mind...",
|
| 277 |
+
height=100
|
| 278 |
+
)
|
| 279 |
+
|
| 280 |
+
if message and st.button("๐ซ Get Support"):
|
| 281 |
+
with st.spinner("๐ค Thinking..."):
|
| 282 |
+
import time
|
| 283 |
+
time.sleep(1)
|
| 284 |
+
|
| 285 |
+
responses = [
|
| 286 |
+
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.",
|
| 287 |
+
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.",
|
| 288 |
+
f"Regarding {topic.lower()}, I want you to know that '{message}' resonates with me. Remember, you have inner strength and wisdom to navigate this."
|
| 289 |
+
]
|
| 290 |
+
|
| 291 |
+
response = random.choice(responses)
|
| 292 |
+
|
| 293 |
+
st.markdown(f"""
|
| 294 |
+
<div style="margin: 20px 0;">
|
| 295 |
+
<div style="background: #E5E7EB; padding: 15px; border-radius: 15px; margin-bottom: 10px;">
|
| 296 |
+
<strong>You:</strong> {message}
|
| 297 |
+
</div>
|
| 298 |
+
<div style="background: #6366F1; color: white; padding: 15px; border-radius: 15px;">
|
| 299 |
+
<strong>๐ค AI Guide:</strong> {response}
|
| 300 |
+
<br><br>
|
| 301 |
+
<small>๐ I'm here to support you. For serious concerns, please reach out to a professional.</small>
|
| 302 |
+
</div>
|
| 303 |
+
</div>
|
| 304 |
+
""", unsafe_allow_html=True)
|
| 305 |
+
```
|
| 306 |
+
|
| 307 |
+
# ้ ่
ณ
|
| 308 |
+
|
| 309 |
+
st.markdown(โโโ)
|
| 310 |
+
st.markdown(โโโ
|
| 311 |
+
|
| 312 |
+
<div style="text-align: center; color: #6B7280; padding: 2rem;">
|
| 313 |
+
<p>๐งญ <strong>SoulCompass</strong> - Find Your Inner North Star</p>
|
| 314 |
+
<p>Made with โค๏ธ for spiritual seekers worldwide</p>
|
| 315 |
+
<p>๐ <a href="#" style="color: #6366F1;">Upgrade to Pro</a> | ๐ง support@soulcompass.ai | ๐ soulcompass.ai</p>
|
| 316 |
+
</div>
|
| 317 |
+
""", unsafe_allow_html=True)
|