File size: 2,348 Bytes
7c735e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
import gradio as gr
from gradio.themes.base import Base
from gradio.themes.utils import colors, fonts, sizes

# Custom Theme Class
class FastRTCOrangeTheme(Base):
    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,
        text_size=sizes.text_md,
        font=(fonts.GoogleFont("Poppins"), "ui-sans-serif", "sans-serif"),
        font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
    ):
        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,
        )

        super().set(
            # Background & Layout
            body_background_fill="linear-gradient(135deg, #FFF7ED, #FFEDD5)",  
            body_text_color="#000000",

            # Block / Panels
            block_background_fill="white",
            block_shadow="0 4px 12px rgba(0, 0, 0, 0.05)",
            block_border_width="1px",
            block_title_text_weight="700",

            # Buttons (Primary: Orange)
            button_primary_background_fill="linear-gradient(90deg, #F97316, #FB923C)",  # Orange gradient
            button_primary_background_fill_hover="linear-gradient(90deg, #EA580C, #F97316)",
            button_primary_text_color="white",
            button_primary_shadow="0 2px 6px rgba(251, 146, 60, 0.4)",

            # Buttons (Secondary: Subtle Neutral)
            button_secondary_background_fill="#F8FAFC",
            button_secondary_text_color="#1F2937",
            button_secondary_shadow="0 1px 3px rgba(0, 0, 0, 0.1)",

            # Sliders, Inputs
            slider_color="#F97316",  # Orange slider
            input_border_color="#E2E8F0",
            input_border_color_focus="#F97316",
            input_shadow="0 0 0 2px rgba(249, 115, 22, 0.2)",

            # Loader & Progress
            loader_color="#FB923C",  

            # Links & Highlights
            link_text_color="#F97316",
            link_text_color_hover="#EA580C"
        )

fast_rtc_theme = FastRTCOrangeTheme()