Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,19 +22,19 @@ def hide_and_show_panel():
|
|
22 |
|
23 |
# Create the Gradio interface
|
24 |
with gr.Blocks() as demo:
|
25 |
-
# Textbox where the first word is entered
|
26 |
-
user_text = gr.Textbox(label="Escribe 'user' para continuar")
|
27 |
-
|
28 |
-
# Textbox where the word "casa" is entered
|
29 |
-
input_text = gr.Textbox(label="Escribe 'casa' para mostrar el panel", type="password")
|
30 |
-
|
31 |
-
# First button, visible from the start
|
32 |
-
btn_1 = gr.Button("Bot贸n 1 (Siempre visible)")
|
33 |
|
34 |
# Create the first panel (visible from the start)
|
35 |
with gr.Column() as panel_1:
|
36 |
-
#
|
37 |
-
user_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
# Create the second panel that is initially hidden
|
40 |
with gr.Column(visible=False) as panel_2:
|
@@ -44,8 +44,7 @@ with gr.Blocks() as demo:
|
|
44 |
btn_2 = gr.Button("Ocultar el Panel", visible=True)
|
45 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
|
46 |
|
47 |
-
|
48 |
-
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1]) # Hide Panel 1 and show Panel 2
|
49 |
|
50 |
# Launch the Gradio interface
|
51 |
demo.launch()
|
@@ -54,3 +53,4 @@ demo.launch()
|
|
54 |
|
55 |
|
56 |
|
|
|
|
22 |
|
23 |
# Create the Gradio interface
|
24 |
with gr.Blocks() as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
# Create the first panel (visible from the start)
|
27 |
with gr.Column() as panel_1:
|
28 |
+
# Textbox where the first word is entered
|
29 |
+
user_text = gr.Textbox(label="Escribe 'user' para continuar")
|
30 |
+
|
31 |
+
# Textbox where the word "casa" is entered
|
32 |
+
input_text = gr.Textbox(label="Escribe 'casa' para mostrar el panel", type="password")
|
33 |
+
|
34 |
+
# First button, visible from the start
|
35 |
+
btn_1 = gr.Button("Bot贸n 1 (Siempre visible)")
|
36 |
+
# Configure the buttons and the panel visibility
|
37 |
+
btn_1.click(check_words, inputs=[user_text, input_text], outputs=[panel_2, panel_1]) # Hide Panel 1 and show Panel 2
|
38 |
|
39 |
# Create the second panel that is initially hidden
|
40 |
with gr.Column(visible=False) as panel_2:
|
|
|
44 |
btn_2 = gr.Button("Ocultar el Panel", visible=True)
|
45 |
btn_2.click(hide_and_show_panel, outputs=[panel_2, panel_1]) # Hide Panel 2 and show Panel 1
|
46 |
|
47 |
+
|
|
|
48 |
|
49 |
# Launch the Gradio interface
|
50 |
demo.launch()
|
|
|
53 |
|
54 |
|
55 |
|
56 |
+
|