1024m commited on
Commit
66798be
·
verified ·
1 Parent(s): f309c7a

Update theme.py

Browse files
Files changed (1) hide show
  1. theme.py +5 -41
theme.py CHANGED
@@ -1,66 +1,30 @@
1
  import gradio as gr
2
  from gradio.themes.base import Base
3
  from gradio.themes.utils import colors, fonts, sizes
4
-
5
- # Custom Theme Class
6
- class FastRTCOrangeTheme(Base):
7
- def __init__(
8
- self,
9
- *,
10
- primary_hue=colors.orange,
11
- secondary_hue=colors.amber,
12
- neutral_hue=colors.gray,
13
- spacing_size=sizes.spacing_md,
14
- radius_size=sizes.radius_lg,
15
- text_size=sizes.text_md,
16
- font=(fonts.GoogleFont("Poppins"), "ui-sans-serif", "sans-serif"),
17
- font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
18
- ):
19
- super().__init__(
20
- primary_hue=primary_hue,
21
- secondary_hue=secondary_hue,
22
- neutral_hue=neutral_hue,
23
- spacing_size=spacing_size,
24
- radius_size=radius_size,
25
- text_size=text_size,
26
- font=font,
27
- font_mono=font_mono,
28
- )
29
-
30
  super().set(
31
- # Background & Layout
32
  body_background_fill="linear-gradient(135deg, #FFF7ED, #FFEDD5)",
33
  body_text_color="#000000",
34
-
35
- # Block / Panels
36
  block_background_fill="white",
37
  block_shadow="0 4px 12px rgba(0, 0, 0, 0.05)",
38
  block_border_width="1px",
39
  block_title_text_weight="700",
40
-
41
- # Buttons (Primary: Orange)
42
  button_primary_background_fill="linear-gradient(90deg, #F97316, #FB923C)", # Orange gradient
43
  button_primary_background_fill_hover="linear-gradient(90deg, #EA580C, #F97316)",
44
  button_primary_text_color="white",
45
  button_primary_shadow="0 2px 6px rgba(251, 146, 60, 0.4)",
46
-
47
- # Buttons (Secondary: Subtle Neutral)
48
  button_secondary_background_fill="#F8FAFC",
49
  button_secondary_text_color="#1F2937",
50
  button_secondary_shadow="0 1px 3px rgba(0, 0, 0, 0.1)",
51
-
52
- # Sliders, Inputs
53
  slider_color="#F97316", # Orange slider
54
  input_border_color="#E2E8F0",
55
  input_border_color_focus="#F97316",
56
  input_shadow="0 0 0 2px rgba(249, 115, 22, 0.2)",
57
-
58
- # Loader & Progress
59
  loader_color="#FB923C",
60
-
61
- # Links & Highlights
62
  link_text_color="#F97316",
63
  link_text_color_hover="#EA580C"
64
  )
65
-
66
- fast_rtc_theme = FastRTCOrangeTheme()
 
1
  import gradio as gr
2
  from gradio.themes.base import Base
3
  from gradio.themes.utils import colors, fonts, sizes
4
+ class FastRTCTheme(Base):
5
+ def __init__(self, *, primary_hue=colors.orange, secondary_hue=colors.amber, neutral_hue=colors.gray, spacing_size=sizes.spacing_md, radius_size=sizes.radius_lg,
6
+ text_size=sizes.text_md, font=(fonts.GoogleFont("Poppins"), "ui-sans-serif", "sans-serif"), font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),):
7
+ super().__init__(primary_hue=primary_hue, secondary_hue=secondary_hue, neutral_hue=neutral_hue, spacing_size=spacing_size, radius_size=radius_size, text_size=text_size, font=font, font_mono=font_mono,)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  super().set(
 
9
  body_background_fill="linear-gradient(135deg, #FFF7ED, #FFEDD5)",
10
  body_text_color="#000000",
 
 
11
  block_background_fill="white",
12
  block_shadow="0 4px 12px rgba(0, 0, 0, 0.05)",
13
  block_border_width="1px",
14
  block_title_text_weight="700",
 
 
15
  button_primary_background_fill="linear-gradient(90deg, #F97316, #FB923C)", # Orange gradient
16
  button_primary_background_fill_hover="linear-gradient(90deg, #EA580C, #F97316)",
17
  button_primary_text_color="white",
18
  button_primary_shadow="0 2px 6px rgba(251, 146, 60, 0.4)",
 
 
19
  button_secondary_background_fill="#F8FAFC",
20
  button_secondary_text_color="#1F2937",
21
  button_secondary_shadow="0 1px 3px rgba(0, 0, 0, 0.1)",
 
 
22
  slider_color="#F97316", # Orange slider
23
  input_border_color="#E2E8F0",
24
  input_border_color_focus="#F97316",
25
  input_shadow="0 0 0 2px rgba(249, 115, 22, 0.2)",
 
 
26
  loader_color="#FB923C",
 
 
27
  link_text_color="#F97316",
28
  link_text_color_hover="#EA580C"
29
  )
30
+ fast_rtc_theme = FastRTCTheme()