File size: 1,481 Bytes
6634db1 4cb7e61 8f4468f 71752e6 f025fac 71752e6 7bf31ad c84a6e6 6614cbc 6634db1 c84a6e6 6614cbc 6634db1 9ee7f8a 167765f 6634db1 6614cbc 8425a5b c84a6e6 6614cbc 6634db1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import gradio as gr
sky = "https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/sky.png"
platform = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/platform.png'
star = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/star.png'
bomb = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/bomb.png'
dude = 'https://huggingface.co/spaces/Omnibus/game-test/resolve/main/assets/dude.png'
load_js=f"""
var sky_img = {sky};
var platform_img = {platform};
var star_img = {star};
var bomb_img = {bomb};
var dude_img = {dude};
let myIframe = document.getElementById("myIframe");
let url_string = "https://omnibus-game-test-static.static.hf.space";
let adsURL = url_string+"?sky="+sky_img+"&platform="+platform_img;
console.log(adsURL);
myIframe.src = adsURL;
"""
# src="https://omnibus-game-test-static.static.hf.space?sky={sky}&platform={platform}&star={star}&bomb={bomb}&dude={dude}"
html_mod=f"""
<div id="demo">
<iframe
id="myIframe"
src="https://omnibus-game-test-static.static.hf.space?sky={sky}&platform={platform}&star={star}&bomb={bomb}&dude={dude}"
frameborder="0"
width="100%"
height="100%"
></iframe>
</div>"""
with open("tmp.html","w") as f:
f.write(html_mod)
f.close
with gr.Blocks() as app:
gr.HTML(tmp.html)
btn=gr.Button()
btn.click(None,None,None)
app.launch() |