Spaces:
Sleeping
Sleeping
Deploy Myco from CI
Browse files- ui/interface.py +13 -13
ui/interface.py
CHANGED
|
@@ -199,20 +199,20 @@ import gradio as gr
|
|
| 199 |
from game.engine import get_myco_narrative
|
| 200 |
|
| 201 |
def render_shroom_tab():
|
| 202 |
-
with gr.
|
| 203 |
with gr.Tab("✨ Magic Mushroom Garden"):
|
| 204 |
-
#
|
| 205 |
-
|
| 206 |
-
# 1. Your existing animation
|
| 207 |
-
gr.HTML(value=cute_mushroom_garden_html())
|
| 208 |
-
|
| 209 |
-
# 2. The narrative overlay (positioned on top via CSS)
|
| 210 |
-
narrative = gr.Markdown(
|
| 211 |
-
value="Waiting for the forest to wake...",
|
| 212 |
-
elem_id="narrative-overlay"
|
| 213 |
-
)
|
| 214 |
|
| 215 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
|
| 217 |
|
| 218 |
-
return
|
|
|
|
|
|
| 199 |
from game.engine import get_myco_narrative
|
| 200 |
|
| 201 |
def render_shroom_tab():
|
| 202 |
+
with gr.Blocks() as demo:
|
| 203 |
with gr.Tab("✨ Magic Mushroom Garden"):
|
| 204 |
+
# 1. Your working iframe remains untouched
|
| 205 |
+
gr.HTML(value=cute_mushroom_garden_html())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
|
| 207 |
+
# 2. Simple Markdown component for the narrative
|
| 208 |
+
narrative = gr.Markdown(
|
| 209 |
+
value="...",
|
| 210 |
+
elem_id="simple-narrative"
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
# 3. Direct Timer to update the markdown
|
| 214 |
+
# Every 20 seconds, it runs your engine function and updates the text
|
| 215 |
gr.Timer(20).tick(fn=get_myco_narrative, outputs=narrative)
|
| 216 |
|
| 217 |
+
return demo
|
| 218 |
+
|