nirajandhakal commited on
Commit
5e1f3c0
·
verified ·
1 Parent(s): 77847a2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -4
app.py CHANGED
@@ -163,7 +163,7 @@ with gr.Blocks(css=css) as demo:
163
 
164
  download_format = gr.Radio(
165
  label="Download Format",
166
- choices=["PNG", "JPEG", "SVG"],
167
  value="PNG",
168
  type="value",
169
  )
@@ -184,9 +184,20 @@ with gr.Blocks(css=css) as demo:
184
  cache_examples="lazy"
185
  )
186
 
187
- share_button = gr.Button("Share on Twitter")
188
- share_button.click(
189
- fn=lambda img: f"https://twitter.com/intent/post?url={img}",
 
 
 
 
 
 
 
 
 
 
 
190
  inputs=[result],
191
  outputs=None,
192
  _js="(img) => window.open(img, '_blank')"
 
163
 
164
  download_format = gr.Radio(
165
  label="Download Format",
166
+ choices=["PNG", "JPEG", "SVG", "WEBP"],
167
  value="PNG",
168
  type="value",
169
  )
 
184
  cache_examples="lazy"
185
  )
186
 
187
+ share_buttons = gr.Row()
188
+ with share_buttons:
189
+ twitter_button = gr.Button("Share on Twitter")
190
+ facebook_button = gr.Button("Share on Facebook")
191
+
192
+ twitter_button.click(
193
+ fn=lambda img: f"https://twitter.com/intent/tweet?url={img}",
194
+ inputs=[result],
195
+ outputs=None,
196
+ _js="(img) => window.open(img, '_blank')"
197
+ )
198
+
199
+ facebook_button.click(
200
+ fn=lambda img: f"https://www.facebook.com/sharer/sharer.php?u={img}",
201
  inputs=[result],
202
  outputs=None,
203
  _js="(img) => window.open(img, '_blank')"