Spaces:
Running
Running
File size: 8,479 Bytes
fcaa525 660316c 3f3b8ad fcaa525 3f3b8ad fcaa525 660316c 3f3b8ad 660316c da37e9a a22942c 9a2e3f1 a22942c 3f3b8ad a22942c 3f3b8ad 660316c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
import gradio as gr
import random
from datetime import datetime
# Complete Tarot Card Dictionary
tarot_cards = {
"โจ The Fool โจ": {
"meaning": "New beginnings, innocence, spontaneity",
"description": "๐ A fresh start awaits! Take that leap of faith with an open heart.",
"image": "fool.jpg"
},
"๐ฏ The Magician ๐ฏ": {
"meaning": "Manifestation, resourcefulness, power",
"description": "โก You have all tools to manifest your desires. Trust your abilities!",
"image": "magician.jpg"
},
"๐ The High Priestess ๐": {
"meaning": "Intuition, mystery, inner wisdom",
"description": "๐ Listen to your inner voice. Deep wisdom lies within.",
"image": "priestess.jpg"
},
"๐บ The Empress ๐บ": {
"meaning": "Abundance, nurturing, fertility",
"description": "๐ธ Embrace your creative power and nurture growth.",
"image": "empress.jpg"
},
"โ๏ธ The Emperor โ๏ธ": {
"meaning": "Authority, structure, leadership",
"description": "๐ Time to take charge and establish order.",
"image": "emperor.jpg"
},
"๐๏ธ The Hierophant ๐๏ธ": {
"meaning": "Tradition, spirituality, guidance",
"description": "๐ Seek wisdom from traditional sources and mentors.",
"image": "hierophant.jpg"
},
"โค๏ธ The Lovers โค๏ธ": {
"meaning": "Love, harmony, relationships",
"description": "๐ Important choices about relationships await.",
"image": "lovers.jpg"
},
"๐ The Chariot ๐": {
"meaning": "Victory, willpower, determination",
"description": "๐ฏ Success through determination and self-control.",
"image": "chariot.jpg"
},
"๐ฆ Strength ๐ฆ": {
"meaning": "Courage, patience, inner strength",
"description": "๐ช Overcome challenges through inner power.",
"image": "strength.jpg"
},
"๐ฎ The Hermit ๐ฎ": {
"meaning": "Introspection, searching, guidance",
"description": "๐ Time for inner reflection and spiritual search.",
"image": "hermit.jpg"
},
"๐ก Wheel of Fortune ๐ก": {
"meaning": "Destiny, cycles, turning point",
"description": "๐ Change is coming. Fortune favors the prepared.",
"image": "wheel.jpg"
},
"โ๏ธ Justice โ๏ธ": {
"meaning": "Justice, fairness, truth",
"description": "๐ Truth and karma will prevail.",
"image": "justice.jpg"
},
"๐ The Hanged Man ๐": {
"meaning": "Surrender, letting go, new perspective",
"description": "๐ See things from a different angle.",
"image": "hanged.jpg"
},
"๐ฆ Death ๐ฆ": {
"meaning": "Transformation, endings, change",
"description": "๐ End of one chapter, beginning of another.",
"image": "death.jpg"
},
"๐ Temperance ๐": {
"meaning": "Balance, moderation, harmony",
"description": "โฏ๏ธ Find middle ground and inner peace.",
"image": "temperance.jpg"
},
"๐ The Devil ๐": {
"meaning": "Bondage, materialism, temptation",
"description": "โ๏ธ Break free from what binds you.",
"image": "devil.jpg"
},
"โก The Tower โก": {
"meaning": "Sudden change, chaos, revelation",
"description": "๐ฅ Dramatic change leads to breakthrough.",
"image": "tower.jpg"
},
"โญ The Star โญ": {
"meaning": "Hope, inspiration, serenity",
"description": "โจ Light shines in the darkness.",
"image": "star.jpg"
},
"๐ The Moon ๐": {
"meaning": "Illusion, intuition, dreams",
"description": "๐ Trust your intuition in uncertain times.",
"image": "moon.jpg"
},
"โ๏ธ The Sun โ๏ธ": {
"meaning": "Joy, success, vitality",
"description": "๐ Positivity and success shine bright.",
"image": "sun.jpg"
},
"๐ฏ Judgement ๐ฏ": {
"meaning": "Rebirth, inner calling, absolution",
"description": "๐ Answer the call to higher purpose.",
"image": "judgement.jpg"
},
"๐ The World ๐": {
"meaning": "Completion, achievement, integration",
"description": "๐ A cycle completes, bringing fulfillment.",
"image": "world.jpg"
}
}
def get_reading(question, selected_cards):
if not selected_cards:
return "โ ๏ธ Please select at least one card for your reading."
result = f"""
๐ฎ YOUR MYSTICAL TAROT READING ๐ฎ
๐ซ Question: {question}
โง๏ฝฅ๏พ: *โง๏ฝฅ๏พ:* *:๏ฝฅ๏พโง*:๏ฝฅ๏พโง
"""
for i, card in enumerate(selected_cards, 1):
card_info = tarot_cards[card]
result += f"""
โจ Card {i}: {card}
๐ด Meaning: {card_info['meaning']}
๐ Message: {card_info['description']}
โยฐโยฐโยฐโยฐโยฐโยฐโยฐโยฐโยฐโยฐโ
"""
return result + "\n\n๐ May these insights guide your path! ๐"
# ... (์ด์ tarot_cards ๋์
๋๋ฆฌ์ get_reading ํจ์๋ ๋์ผ)
with gr.Blocks(
theme=gr.themes.Soft(
primary_hue="purple",
secondary_hue="pink",
neutral_hue="slate",
font=["Arial", "sans-serif"]
),
css="""
.gradio-container {
background: linear-gradient(to right, #1a1a2e, #16213e);
color: white;
}
.gr-button {
background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
border: none;
color: white;
}
.gr-input {
border: 2px solid #ff6b6b;
}
.gr-box {
border-radius: 15px;
border: 2px solid #ff6b6b;
}
.gr-padded {
padding: 20px;
}
"""
) as demo:
gr.HTML("""<h1 style='text-align: center'>โจ Mystical Tarot Reading Experience โจ</h1>""")
gr.HTML("""
<div style='text-align: center'>
๐ Welcome to Your Personal Tarot Journey ๐<br><br>
๐ด How to Use:<br>
1. ๐ญ Focus on your question<br>
2. ๐ Select 1-5 cards that call to you<br>
3. ๐ Receive your personalized mystical reading<br><br>
๐ Let the ancient wisdom guide your path ๐
</div>
""")
with gr.Row():
with gr.Column():
question = gr.Textbox(
label="๐ค What would you like to know?",
placeholder="Enter your question here...",
lines=3
)
cards = gr.CheckboxGroup(
choices=list(tarot_cards.keys()),
label="๐ด Select Your Cards (Max 5)",
info="Choose 1-5 cards for your reading"
)
submit_btn = gr.Button("๐ฎ Get Your Reading", variant="primary")
with gr.Column():
output = gr.Textbox(
label="๐ฎ Your Mystical Reading",
lines=20
)
def validate_and_read(question, selected_cards):
if not selected_cards:
return "โ ๏ธ Please select at least one card for your reading."
if len(selected_cards) > 5:
selected_cards = selected_cards[:5]
return get_reading(question, selected_cards)
submit_btn.click(
fn=validate_and_read,
inputs=[question, cards],
outputs=output
)
# Examples
gr.Examples(
examples=[
["What energies surround my current path? ๐ฃ๏ธ", ["โจ The Fool โจ", "๐ฏ The Magician ๐ฏ"]],
["What should I know about my love life? โค๏ธ", ["โค๏ธ The Lovers โค๏ธ", "๐บ The Empress ๐บ"]],
["Guide me about my career decisions ๐ผ", ["โ๏ธ The Emperor โ๏ธ", "๐ก Wheel of Fortune ๐ก"]],
["What's my spiritual lesson for this month? ๐", ["๐๏ธ The Hierophant ๐๏ธ", "๐ฎ The Hermit ๐ฎ", "โญ The Star โญ"]]
],
inputs=[question, cards]
)
gr.HTML("""
<div style="text-align: center; margin-top: 20px;">
<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fopenfree-tarotcard.hf.space">
<img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fopenfree-tarotcard.hf.space&countColor=%23263759" />
</a>
</div>
""")
if __name__ == "__main__":
demo.launch(share=True) |