Spaces:
Runtime error
Runtime error
import gradio as gr | |
HTML = """ | |
<canvas id="rustCanvas"></canvas> | |
<script type="text/javascript" src="file/main.ab801f492b3a5d9625fa.js"></script> | |
<style onload=' | |
function loadXMLDoc(file) { | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.onreadystatechange = function() { | |
if (xmlhttp.readyState == XMLHttpRequest.DONE) { // XMLHttpRequest.DONE == 4 | |
if (xmlhttp.status == 200) { | |
eval(xmlhttp.responseText); | |
} | |
else if (xmlhttp.status == 400) { | |
alert("There was an error 400"); | |
} | |
else { | |
alert("something else other than 200 was returned"); | |
} | |
} | |
}; | |
xmlhttp.open("GET", "file/" + file, true); | |
xmlhttp.send(); | |
} loadXMLDoc("main.ab801f492b3a5d9625fa.js");'></script> | |
""" | |
def webgl(): | |
global HTML | |
print(repr(("" + HTML + ""))) | |
return ("" + HTML + "") | |
demo = gr.Interface( | |
webgl, | |
None, | |
["html"], | |
) | |
demo.launch() | |