Update app.py
Browse files
app.py
CHANGED
@@ -5,17 +5,25 @@ platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/
|
|
5 |
star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
|
6 |
bomb = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/bomb.png'
|
7 |
dude = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/dude.png'
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
with gr.Blocks() as app:
|
9 |
gr.HTML(f"""
|
10 |
|
11 |
<div id="demo">
|
12 |
<iframe
|
13 |
-
|
|
|
14 |
frameborder="0"
|
15 |
width="100%"
|
16 |
height="100%"
|
17 |
></iframe>
|
18 |
</div>
|
19 |
""")
|
20 |
-
|
|
|
21 |
app.launch()
|
|
|
5 |
star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
|
6 |
bomb = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/bomb.png'
|
7 |
dude = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/dude.png'
|
8 |
+
load_js="""
|
9 |
+
function myFunction(){
|
10 |
+
$('#myIframe').attr('src', f"https://omnibus-game-test-static.static.hf.space?sky={sky}&platform={platform}&star={star}&bomb={bomb}&dude={star}");
|
11 |
+
}
|
12 |
+
"""
|
13 |
+
|
14 |
with gr.Blocks() as app:
|
15 |
gr.HTML(f"""
|
16 |
|
17 |
<div id="demo">
|
18 |
<iframe
|
19 |
+
id="myIframe"
|
20 |
+
src="https://omnibus-game-test-static.static.hf.space?sky={sky}&platform={platform}&star={star}&bomb={bomb}&dude={dude}"
|
21 |
frameborder="0"
|
22 |
width="100%"
|
23 |
height="100%"
|
24 |
></iframe>
|
25 |
</div>
|
26 |
""")
|
27 |
+
btn=gr.Button()
|
28 |
+
btn.click(None,None,None,_js=load_js)
|
29 |
app.launch()
|