Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,7 @@ def details_fn(query):
|
|
119 |
except Exception as e:
|
120 |
format_out = "None"
|
121 |
print (e)
|
122 |
-
return out,format_out
|
123 |
|
124 |
def first():
|
125 |
out = '''<h1>Loading'''
|
@@ -209,7 +209,8 @@ function() {
|
|
209 |
return [link_url];
|
210 |
}
|
211 |
"""
|
212 |
-
|
|
|
213 |
|
214 |
with gr.Blocks() as app:
|
215 |
gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
|
@@ -222,15 +223,25 @@ with gr.Blocks() as app:
|
|
222 |
input = gr.Textbox(label = "URL")
|
223 |
btn = gr.Button("Preview")
|
224 |
details = gr.HTML("""""")
|
225 |
-
|
226 |
-
|
227 |
-
|
|
|
|
|
|
|
|
|
228 |
with gr.Row() as im_row:
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
app.load(None,None,link_list,js=load_js)
|
232 |
app.load(None,None,link_list,js=link_js)
|
233 |
-
images.change(
|
234 |
search_btn.click(search_fn,[search_box,num_return],output)
|
235 |
-
btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images])
|
236 |
app.launch()
|
|
|
119 |
except Exception as e:
|
120 |
format_out = "None"
|
121 |
print (e)
|
122 |
+
return out,format_out,title,description
|
123 |
|
124 |
def first():
|
125 |
out = '''<h1>Loading'''
|
|
|
209 |
return [link_url];
|
210 |
}
|
211 |
"""
|
212 |
+
def update_im(im=None):
|
213 |
+
return im
|
214 |
|
215 |
with gr.Blocks() as app:
|
216 |
gr.HTML("""<h1>Interactive Social Media Card Maker</h1>""")
|
|
|
223 |
input = gr.Textbox(label = "URL")
|
224 |
btn = gr.Button("Preview")
|
225 |
details = gr.HTML("""""")
|
226 |
+
with gr.Accordion("Iframe"):
|
227 |
+
output = gr.HTML("""""")
|
228 |
+
gr.HTML("""<h3><b>Step 2:</b> Select the Image to use on the Card</h3>""")
|
229 |
+
with gr.Accordion("Images"):
|
230 |
+
images = gr.HTML("""""")
|
231 |
+
gr.HTML("""<h3><b>Step 3:</b> Build the Card </h3>""")
|
232 |
+
|
233 |
with gr.Row() as im_row:
|
234 |
+
with gr.Column():
|
235 |
+
title=gr.Textbox(label="Title")
|
236 |
+
description=gr.Textbox(label="Description")
|
237 |
+
link_list=gr.Textbox(label="Image URL")
|
238 |
+
|
239 |
+
with gr.Column():
|
240 |
+
prvw_btn=gr.Button("Update")
|
241 |
+
bld_btn=gr.Button("Build Card")
|
242 |
app.load(None,None,link_list,js=load_js)
|
243 |
app.load(None,None,link_list,js=link_js)
|
244 |
+
images.change(update_im,None,link_list,trigger_mode="multiple",js=link_js)
|
245 |
search_btn.click(search_fn,[search_box,num_return],output)
|
246 |
+
btn.click(first,None,output).then(test_single,input,output).then(details_fn,input,[details,images,title,description])
|
247 |
app.launch()
|