Spaces:
Sleeping
Sleeping
lovodkin93
commited on
Commit
•
81b6700
1
Parent(s):
78e6dde
Update app.py
Browse files
app.py
CHANGED
@@ -28,15 +28,12 @@ def show_html_in_iframe(page_idx):
|
|
28 |
iframe_html = f'<iframe src="{url}" width="100%" height="2000"></iframe>'
|
29 |
return iframe_html
|
30 |
|
31 |
-
|
32 |
-
slider
|
|
|
33 |
|
34 |
-
# Create the Gradio interface
|
35 |
-
|
36 |
-
inputs=slider,
|
37 |
-
outputs=gr.HTML(),
|
38 |
-
title="HTML Viewer with Event Listeners",
|
39 |
-
description="Displays HTML content with JavaScript event listeners via an iframe.")
|
40 |
|
41 |
# Display the interface
|
42 |
-
|
|
|
28 |
iframe_html = f'<iframe src="{url}" width="100%" height="2000"></iframe>'
|
29 |
return iframe_html
|
30 |
|
31 |
+
with gr.Blocks() as demo:
|
32 |
+
# Create a slider component to select the HTML page
|
33 |
+
slider = gr.Slider(minimum=0, maximum=len(html_files)-1, step=1, label='Data Instance')
|
34 |
|
35 |
+
# Create the Gradio interface
|
36 |
+
slider.release(show_html_in_iframe, inputs=[slider], outputs=[gr.HTML()], api_name="HTML Viewer with Event Listeners")
|
|
|
|
|
|
|
|
|
37 |
|
38 |
# Display the interface
|
39 |
+
demo.launch()
|