Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -209,14 +209,16 @@ function() {
|
|
209 |
return [link_url];
|
210 |
}
|
211 |
"""
|
212 |
-
def
|
213 |
print (im)
|
214 |
if not im.startswith("https:"):
|
215 |
im = f'https:{im}'
|
216 |
out = f"""<body><div><img src={im}></div></body>"""
|
217 |
print(out)
|
218 |
return out
|
219 |
-
|
|
|
|
|
220 |
with gr.Blocks() as app:
|
221 |
gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
|
222 |
gr.HTML("""<h3><b>Step 1:</b> Enter a URL with Iframe capability</h3>""")
|
@@ -240,16 +242,21 @@ with gr.Blocks() as app:
|
|
240 |
title=gr.Textbox(label="Title")
|
241 |
description=gr.Textbox(label="Description")
|
242 |
link_list=gr.Textbox(label="Image URL")
|
|
|
|
|
243 |
#img_card=gr.Image()
|
244 |
with gr.Column():
|
|
|
|
|
245 |
prepare_btn=gr.Button("Prepare Card")
|
246 |
bld_btn=gr.Button("Build Card")
|
247 |
-
|
248 |
-
|
249 |
app.load(None,None,link_list,js=load_js)
|
250 |
app.load(None,None,link_list,js=link_js)
|
251 |
-
|
252 |
-
|
|
|
253 |
#images.change(update_im,None,link_list,trigger_mode="multiple",js=link_js)
|
254 |
search_btn.click(search_fn,[search_box,num_return],output)
|
255 |
btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images,title,description])
|
|
|
209 |
return [link_url];
|
210 |
}
|
211 |
"""
|
212 |
+
def preview_img(im):
|
213 |
print (im)
|
214 |
if not im.startswith("https:"):
|
215 |
im = f'https:{im}'
|
216 |
out = f"""<body><div><img src={im}></div></body>"""
|
217 |
print(out)
|
218 |
return out
|
219 |
+
def prepare_card(title,description,img):
|
220 |
+
out_link=""
|
221 |
+
return(out_link)
|
222 |
with gr.Blocks() as app:
|
223 |
gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
|
224 |
gr.HTML("""<h3><b>Step 1:</b> Enter a URL with Iframe capability</h3>""")
|
|
|
242 |
title=gr.Textbox(label="Title")
|
243 |
description=gr.Textbox(label="Description")
|
244 |
link_list=gr.Textbox(label="Image URL")
|
245 |
+
img_card=gr.HTML("""""")
|
246 |
+
|
247 |
#img_card=gr.Image()
|
248 |
with gr.Column():
|
249 |
+
grab_im_url_btn=gr.Button("Load Image URL")
|
250 |
+
preview_image_btn=gr.Button("Preview Image")
|
251 |
prepare_btn=gr.Button("Prepare Card")
|
252 |
bld_btn=gr.Button("Build Card")
|
253 |
+
prepared_html = gr.Textbox(max_lines=50)
|
254 |
+
|
255 |
app.load(None,None,link_list,js=load_js)
|
256 |
app.load(None,None,link_list,js=link_js)
|
257 |
+
grab_im_url_btn.click(None,None,[link_list],js=link_js)
|
258 |
+
preview_image_btn.click(preview_img,link_list,img_card)
|
259 |
+
prepare_btn.click(prepare_card,None,[prepared_html])
|
260 |
#images.change(update_im,None,link_list,trigger_mode="multiple",js=link_js)
|
261 |
search_btn.click(search_fn,[search_box,num_return],output)
|
262 |
btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images,title,description])
|