Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -628,10 +628,41 @@ css = """
|
|
| 628 |
|
| 629 |
/* Mobile responsive styles */
|
| 630 |
@media (max-width: 768px) {
|
| 631 |
-
.main-row {
|
| 632 |
-
|
| 633 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 634 |
#video-output { max-width: 100%; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 635 |
}
|
| 636 |
"""
|
| 637 |
|
|
@@ -661,7 +692,7 @@ def create_app():
|
|
| 661 |
""")
|
| 662 |
|
| 663 |
with gr.Row(elem_classes=["main-row"]):
|
| 664 |
-
with gr.Column(scale=2):
|
| 665 |
video_output = gr.Image(
|
| 666 |
label="Game View",
|
| 667 |
elem_id="video-output",
|
|
@@ -670,11 +701,11 @@ def create_app():
|
|
| 670 |
height=360,
|
| 671 |
show_label=False,
|
| 672 |
)
|
| 673 |
-
with gr.Row():
|
| 674 |
start_btn = gr.Button("🎮 Start Game", variant="primary")
|
| 675 |
stop_btn = gr.Button("⏹ End Game", interactive=False)
|
| 676 |
|
| 677 |
-
with gr.Accordion("World Selection", open=True):
|
| 678 |
gr.Markdown("**Choose a starting world** (or leave blank for random):")
|
| 679 |
|
| 680 |
# Gallery for world selection
|
|
@@ -712,8 +743,6 @@ def create_app():
|
|
| 712 |
lines=2,
|
| 713 |
)
|
| 714 |
|
| 715 |
-
|
| 716 |
-
|
| 717 |
frame_display = gr.Number(label="Frame", value=0, interactive=False)
|
| 718 |
|
| 719 |
# --- Event Handlers ---
|
|
|
|
| 628 |
|
| 629 |
/* Mobile responsive styles */
|
| 630 |
@media (max-width: 768px) {
|
| 631 |
+
.main-row {
|
| 632 |
+
flex-direction: column !important;
|
| 633 |
+
}
|
| 634 |
+
.main-row > div {
|
| 635 |
+
width: 100% !important;
|
| 636 |
+
max-width: 100% !important;
|
| 637 |
+
flex: none !important;
|
| 638 |
+
}
|
| 639 |
+
.controls-column {
|
| 640 |
+
min-width: unset;
|
| 641 |
+
margin-top: 12px;
|
| 642 |
+
}
|
| 643 |
#video-output { max-width: 100%; }
|
| 644 |
+
|
| 645 |
+
/* On mobile, flatten the game-column children and reorder */
|
| 646 |
+
.game-column {
|
| 647 |
+
display: contents !important;
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
/* Make the main-row handle all ordering */
|
| 651 |
+
.main-row {
|
| 652 |
+
display: flex !important;
|
| 653 |
+
flex-direction: column !important;
|
| 654 |
+
}
|
| 655 |
+
|
| 656 |
+
/* Order: video-output wrapper (1), button-row (2), controls-column (3), world-accordion (4) */
|
| 657 |
+
.main-row #video-output { order: 1 !important; }
|
| 658 |
+
.main-row .button-row { order: 2 !important; width: 100% !important; }
|
| 659 |
+
.main-row .controls-column { order: 3 !important; }
|
| 660 |
+
.main-row .world-accordion { order: 4 !important; width: 100% !important; }
|
| 661 |
+
|
| 662 |
+
/* Ensure proper spacing */
|
| 663 |
+
.main-row > * {
|
| 664 |
+
margin-bottom: 8px;
|
| 665 |
+
}
|
| 666 |
}
|
| 667 |
"""
|
| 668 |
|
|
|
|
| 692 |
""")
|
| 693 |
|
| 694 |
with gr.Row(elem_classes=["main-row"]):
|
| 695 |
+
with gr.Column(scale=2, elem_classes=["game-column"]):
|
| 696 |
video_output = gr.Image(
|
| 697 |
label="Game View",
|
| 698 |
elem_id="video-output",
|
|
|
|
| 701 |
height=360,
|
| 702 |
show_label=False,
|
| 703 |
)
|
| 704 |
+
with gr.Row(elem_classes=["button-row"]):
|
| 705 |
start_btn = gr.Button("🎮 Start Game", variant="primary")
|
| 706 |
stop_btn = gr.Button("⏹ End Game", interactive=False)
|
| 707 |
|
| 708 |
+
with gr.Accordion("World Selection", open=True, elem_classes=["world-accordion"]):
|
| 709 |
gr.Markdown("**Choose a starting world** (or leave blank for random):")
|
| 710 |
|
| 711 |
# Gallery for world selection
|
|
|
|
| 743 |
lines=2,
|
| 744 |
)
|
| 745 |
|
|
|
|
|
|
|
| 746 |
frame_display = gr.Number(label="Frame", value=0, interactive=False)
|
| 747 |
|
| 748 |
# --- Event Handlers ---
|