Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import gradio as gr
|
3 |
+
import pandas as pd
|
4 |
+
|
5 |
+
def main():
|
6 |
+
# Title and Introduction
|
7 |
+
st.title("π± Cat Rider π")
|
8 |
+
st.markdown("""
|
9 |
+
## Welcome to Cat Rider!
|
10 |
+
In this immersive adventure, you will explore the thrilling world of feline riders. This game sets the stage for dramatic situations and guided storytelling with engaging interactive elements.
|
11 |
+
""")
|
12 |
+
|
13 |
+
# Rules Table
|
14 |
+
st.markdown("""
|
15 |
+
### π Game Rules
|
16 |
+
| π€οΈ Step | π Description |
|
17 |
+
|---------|----------------|
|
18 |
+
| 1οΈβ£ | Choose your Cat Rider |
|
19 |
+
| 2οΈβ£ | Select the Riding Gear |
|
20 |
+
| 3οΈβ£ | Set off on an Adventure |
|
21 |
+
| 4οΈβ£ | Encounter Challenges and Make Decisions |
|
22 |
+
| 5οΈβ£ | Complete the Quest |
|
23 |
+
""")
|
24 |
+
|
25 |
+
# Character Plot Elements: Dramatic Situations
|
26 |
+
st.markdown("### π Dramatic Situations")
|
27 |
+
|
28 |
+
st.markdown('''#### Situation 1: The Great Feline Escape πͺπ
|
29 |
+
Your cat rider is trapped in an old mansion, which is about to be demolished. Using agility, wit, and bravery, orchestrate the perfect escape.
|
30 |
+
''')
|
31 |
+
|
32 |
+
st.markdown('''#### Situation 2: The Treasure of the Lost Temple ποΈπ±
|
33 |
+
On a quest to retrieve an ancient artifact, your cat rider must navigate through a labyrinth filled with traps and guardian spirits.
|
34 |
+
''')
|
35 |
+
|
36 |
+
st.markdown('''#### Situation 3: The Royal Tournament ππ
|
37 |
+
Compete in a grand tournament where the finest cat riders showcase their skills and bravery to earn the title of the Royal Rider.
|
38 |
+
''')
|
39 |
+
|
40 |
+
# UI Elements
|
41 |
+
st.button('πΎ Choose your Cat Rider')
|
42 |
+
st.slider('Select your gear strength', 1, 10)
|
43 |
+
st.selectbox('Choose your path', ('Forest ποΈ', 'Desert π΅', 'Mountains ποΈ'))
|
44 |
+
|
45 |
+
# Example of Data Table
|
46 |
+
data = {
|
47 |
+
'Gear': ['Helmet', 'Armor', 'Boots', 'Gloves'],
|
48 |
+
'Protection Level': [8, 7, 5, 4]
|
49 |
+
}
|
50 |
+
|
51 |
+
df = pd.DataFrame(data)
|
52 |
+
st.dataframe(df)
|
53 |
+
|
54 |
+
# Gradio Interactive Elements
|
55 |
+
def cat_rider_gear(gear_strength):
|
56 |
+
return f'{gear_strength} - The perfect balance of agility and protection!'
|
57 |
+
|
58 |
+
interface = gr.Interface(
|
59 |
+
fn=cat_rider_gear,
|
60 |
+
inputs=gr.inputs.Slider(minimum=1, maximum=10, default=5, label="Gear Strength"),
|
61 |
+
outputs="text"
|
62 |
+
)
|
63 |
+
|
64 |
+
interface.launch(share=True)
|
65 |
+
|
66 |
+
if __name__ == "__main__":
|
67 |
+
main()
|