mr-robber commited on
Commit
a6774a8
1 Parent(s): 94398b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -0
app.py CHANGED
@@ -3,7 +3,45 @@ from bs4 import BeautifulSoup
3
  import requests
4
  import re
5
  import pandas as pd
 
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  def get_video_address(row):
9
 
 
3
  import requests
4
  import re
5
  import pandas as pd
6
+ from theme_dropdown import create_theme_dropdown # noqa: F401
7
 
8
+ import gradio as gr
9
+
10
+ dropdown, js = create_theme_dropdown()
11
+ with gr.Blocks(theme='gstaff/xkcd') as demo:
12
+ with gr.Row().style(equal_height=True):
13
+ with gr.Column(scale=10):
14
+ gr.Markdown(
15
+ """
16
+ # Theme preview: `xkcd`
17
+ To use this theme, set `theme='gstaff/xkcd'` in `gr.Blocks()` or `gr.Interface()`.
18
+ You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
19
+ of this theme.
20
+ """
21
+ )
22
+ with gr.Column(scale=3):
23
+ with gr.Box():
24
+ dropdown.render()
25
+ toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
26
+
27
+ dropdown.change(None, dropdown, None, _js=js)
28
+ toggle_dark.click(
29
+ None,
30
+ _js="""
31
+ () => {
32
+ document.body.classList.toggle('dark');
33
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
34
+ }
35
+ """,
36
+ )
37
+
38
+ name = gr.Textbox(
39
+ label="Name",
40
+ info="Full name, including middle name. No special characters.",
41
+ placeholder="John Doe",
42
+ value="John Doe",
43
+ interactive=True,
44
+ )
45
 
46
  def get_video_address(row):
47