Omnibus commited on
Commit
7f73e70
1 Parent(s): 8629dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -11
app.py CHANGED
@@ -1,21 +1,19 @@
1
  import gradio as gr
2
 
3
- load_js="""src='https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.js'
4
- """
5
-
6
-
7
- game_js="""
8
-
9
 
10
  async () => {
11
- // set testFn() function on globalThis, so you html onlclick can access it
12
- globalThis.testFn = () => {
13
-
14
  const script = document.createElement("script");
15
  script.onload = () => console.log("module loaded") ;
16
  script.type="module";
17
- script.src = "https://cdn.jsdelivr.net/npm/phaser@3.11.0/dist/phaser.js";
18
  document.head.appendChild(script)
 
 
 
 
 
 
19
 
20
  var config = {
21
  type: Phaser.AUTO,
@@ -227,6 +225,6 @@ with gr.Blocks() as app:
227
  </body>
228
  </html>""")
229
 
230
- #app.load(None,None,None,_js=load_js)
231
  app.load(None,None,None,_js=game_js)
232
  app.launch()
 
1
  import gradio as gr
2
 
3
+ load_js="""
 
 
 
 
 
4
 
5
  async () => {
 
 
 
6
  const script = document.createElement("script");
7
  script.onload = () => console.log("module loaded") ;
8
  script.type="module";
9
+ script.src = "https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js";
10
  document.head.appendChild(script)
11
+ }"""
12
+ game_js="""
13
+
14
+ async () => {
15
+ // set testFn() function on globalThis, so you html onlclick can access it
16
+ globalThis.testFn = () => {
17
 
18
  var config = {
19
  type: Phaser.AUTO,
 
225
  </body>
226
  </html>""")
227
 
228
+ app.load(None,None,None,_js=load_js)
229
  app.load(None,None,None,_js=game_js)
230
  app.launch()