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)