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("""

âœĻ Mystical Tarot Reading Experience âœĻ

""") gr.HTML("""
🌟 Welcome to Your Personal Tarot Journey 🌟

ðŸŽī How to Use:
1. 💭 Focus on your question
2. 🔍 Select 1-5 cards that call to you
3. 📖 Receive your personalized mystical reading

🌙 Let the ancient wisdom guide your path 🌙
""") 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("""
""") if __name__ == "__main__": demo.launch(share=True)