Vivek16 commited on
Commit
19ef795
·
verified ·
1 Parent(s): 8d20f29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -5
app.py CHANGED
@@ -200,17 +200,41 @@ with gr.Blocks() as demo:
200
  </svg>
201
  </a>
202
 
203
- <a href="#" onclick="window.location.href='mailto:sirapurapuvarsha@gmail.com?subject=Hello&body=Hi there'; return false;">
204
- <svg width="28" height="28" viewBox="0 0 24 24" fill="#555">
205
- <path d="M0 3v18h24v-18h-24zm21.518 2l-9.518 7.713-9.518-7.713h19.036zm-19.518 14v-11.817l10 8.104 10-8.104v11.817h-20z"/>
206
- </svg>
207
- </a>
208
 
209
 
210
  </div>
211
  </div>
212
  """)
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  # --- Events ---
215
  settings_btn.click(lambda s: (gr.update(visible=not s), not s), [sidebar_state], [sidebar_col, sidebar_state])
216
  dark_btn.click(toggle_dark_mode, [dark_state], [dark_btn, dark_state], js=toggle_dark_js)
 
200
  </svg>
201
  </a>
202
 
203
+
 
 
 
 
204
 
205
 
206
  </div>
207
  </div>
208
  """)
209
 
210
+
211
+ # --- Email Button (Working Mailto) ---
212
+ email_btn = gr.Button(
213
+ value="", # empty to show only icon
214
+ elem_id="email-btn",
215
+ elem_classes="icon-btn"
216
+ )
217
+
218
+ # Add the SVG for the envelope
219
+ gr.HTML("""
220
+ <svg width="28" height="28" viewBox="0 0 24 24" fill="#555">
221
+ <path d="M0 3v18h24v-18h-24zm21.518 2l-9.518 7.713-9.518-7.713h19.036zm-19.518 14v-11.817l10 8.104 10-8.104v11.817h-20z"/>
222
+ </svg>
223
+ """)
224
+
225
+ # JS to open default mail client
226
+ email_btn.click(
227
+ None,
228
+ [],
229
+ [],
230
+ _js="""
231
+ () => {
232
+ window.location.href='mailto:sirapurapuvarsha@gmail.com?subject=Hello&body=Hi there';
233
+ }
234
+ """
235
+ )
236
+
237
+
238
  # --- Events ---
239
  settings_btn.click(lambda s: (gr.update(visible=not s), not s), [sidebar_state], [sidebar_col, sidebar_state])
240
  dark_btn.click(toggle_dark_mode, [dark_state], [dark_btn, dark_state], js=toggle_dark_js)