Kajise
commited on
Commit
·
9416100
1
Parent(s):
bf23d89
chore: fix indentation
Browse files
app.py
CHANGED
@@ -10,58 +10,58 @@ from gradio.themes.utils import colors, fonts
|
|
10 |
|
11 |
|
12 |
theme = Gradio.themes.Monochrome(
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
)
|
19 |
|
20 |
class PurpleTheme(Base):
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
|
66 |
custom_theme = PurpleTheme()
|
67 |
|
@@ -76,14 +76,14 @@ def run_imaginor(text: str):
|
|
76 |
driver.quit()
|
77 |
|
78 |
if not os.path.isfile('./site_screenshot.png'):
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
Gradio.Interface(
|
84 |
run_imaginor,
|
85 |
Gradio.Textbox(placeholder="Enter your URL here", label="Website URL / Endpoint"),
|
86 |
-
[Gradio.Image(type="filepath", "Screenshot"),
|
87 |
Gradio.Textbox(label="Text result", interactive=False)],
|
88 |
title=title,
|
89 |
description=description,
|
|
|
10 |
|
11 |
|
12 |
theme = Gradio.themes.Monochrome(
|
13 |
+
primary_hue="purple",
|
14 |
+
secondary_hue="purple",
|
15 |
+
neutral_hue="neutral",
|
16 |
+
radius_size=Gradio.themes.sizes.radius_sm,
|
17 |
+
font=[Gradio.themes.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"],
|
18 |
)
|
19 |
|
20 |
class PurpleTheme(Base):
|
21 |
+
def __init__(
|
22 |
+
self,
|
23 |
+
*,
|
24 |
+
primary_hue: colors.Color | str = colors.purple,
|
25 |
+
secondary_hue: colors.Color | str = colors.purple,
|
26 |
+
neutral_hue: colors.Color | str = colors.neutral,
|
27 |
+
spacing_size: sizes.Size | str = sizes.spacing_md,
|
28 |
+
radius_size: sizes.Size | str = sizes.radius_md,
|
29 |
+
font: fonts.Font
|
30 |
+
| str
|
31 |
+
| Iterable[fonts.Font | str] = (
|
32 |
+
fonts.GoogleFont("Inter"),
|
33 |
+
"ui-sans-serif",
|
34 |
+
"sans-serif",
|
35 |
+
),
|
36 |
+
font_mono: fonts.Font
|
37 |
+
| str
|
38 |
+
| Iterable[fonts.Font | str] = (
|
39 |
+
fonts.GoogleFont("Space Grotesk"),
|
40 |
+
"ui-monospace",
|
41 |
+
"monospace",
|
42 |
+
),
|
43 |
+
):
|
44 |
+
super().__init__(
|
45 |
+
primary_hue=primary_hue,
|
46 |
+
secondary_hue=secondary_hue,
|
47 |
+
neutral_hue=neutral_hue,
|
48 |
+
spacing_size=spacing_size,
|
49 |
+
radius_size=radius_size,
|
50 |
+
font=font,
|
51 |
+
font_mono=font_mono,
|
52 |
+
)
|
53 |
+
super().set(
|
54 |
+
button_primary_background_fill="linear-gradient(90deg, *primary_300, *secondary_400)",
|
55 |
+
button_primary_background_fill_hover="linear-gradient(90deg, *primary_200, *secondary_300)",
|
56 |
+
button_primary_text_color="white",
|
57 |
+
button_primary_background_fill_dark="linear-gradient(90deg, *primary_600, *secondary_800)",
|
58 |
+
block_shadow="*shadow_drop_lg",
|
59 |
+
button_shadow="*shadow_drop_lg",
|
60 |
+
input_background_fill="zinc",
|
61 |
+
input_border_color="*secondary_300",
|
62 |
+
input_shadow="*shadow_drop",
|
63 |
+
input_shadow_focus="*shadow_drop_lg",
|
64 |
+
)
|
65 |
|
66 |
custom_theme = PurpleTheme()
|
67 |
|
|
|
76 |
driver.quit()
|
77 |
|
78 |
if not os.path.isfile('./site_screenshot.png'):
|
79 |
+
return ['./site_screenshot.png', 'Website imagined by Imaginor, operation success.']
|
80 |
+
else:
|
81 |
+
return [None, 'Website imagined by Imaginor, operation failed.']
|
82 |
|
83 |
Gradio.Interface(
|
84 |
run_imaginor,
|
85 |
Gradio.Textbox(placeholder="Enter your URL here", label="Website URL / Endpoint"),
|
86 |
+
[Gradio.Image(type="filepath", label="Screenshot"),
|
87 |
Gradio.Textbox(label="Text result", interactive=False)],
|
88 |
title=title,
|
89 |
description=description,
|