Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,9 +9,6 @@ from gradio.themes.utils import colors, fonts, sizes
|
|
| 9 |
# --- Enhanced Custom Theme ---
|
| 10 |
|
| 11 |
class NordTheme(Base):
|
| 12 |
-
"""
|
| 13 |
-
Enhanced Nord theme with improved accessibility and visual polish.
|
| 14 |
-
"""
|
| 15 |
def __init__(self):
|
| 16 |
super().__init__(
|
| 17 |
primary_hue=colors.blue,
|
|
@@ -21,7 +18,6 @@ class NordTheme(Base):
|
|
| 21 |
font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
|
| 22 |
)
|
| 23 |
self.set(
|
| 24 |
-
# Main backgrounds
|
| 25 |
body_background_fill="#2E3440",
|
| 26 |
body_text_color="#ECEFF4",
|
| 27 |
block_background_fill="#3B4252",
|
|
@@ -29,35 +25,50 @@ class NordTheme(Base):
|
|
| 29 |
block_border_color="#4C566A",
|
| 30 |
block_label_background_fill="#434C5E",
|
| 31 |
block_label_text_color="#ECEFF4",
|
| 32 |
-
|
| 33 |
-
# Input styling
|
| 34 |
-
input_background_fill="#434C5E",
|
| 35 |
-
input_border_color="transparent",
|
| 36 |
-
input_text_color="#ECEFF4",
|
| 37 |
-
|
| 38 |
-
# Button styling
|
| 39 |
button_primary_background_fill="#5E81AC",
|
| 40 |
button_primary_background_fill_hover="#81A1C1",
|
| 41 |
button_primary_text_color="#ECEFF4",
|
| 42 |
button_secondary_background_fill="#4C566A",
|
| 43 |
-
button_secondary_background_fill_hover="#
|
| 44 |
button_secondary_text_color="#ECEFF4",
|
| 45 |
-
|
| 46 |
-
# Accent colors
|
| 47 |
border_color_accent="#5E81AC",
|
| 48 |
-
background_fill_primary_dark="#2E3440",
|
| 49 |
-
color_accent_soft="#4c566a",
|
| 50 |
-
|
| 51 |
-
# Global block corner radius
|
| 52 |
block_radius="12px",
|
| 53 |
-
|
| 54 |
-
# Error and success colors
|
| 55 |
color_red="#BF616A",
|
| 56 |
color_green="#A3BE8C",
|
| 57 |
color_yellow="#EBCB8B",
|
| 58 |
color_orange="#D08770",
|
| 59 |
)
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
# --- Enhanced Configuration ---
|
| 63 |
|
|
@@ -385,15 +396,18 @@ def create_footer():
|
|
| 385 |
|
| 386 |
# --- Main Application ---
|
| 387 |
|
| 388 |
-
with gr.Blocks(
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
|
|
|
|
|
|
|
|
|
| 397 |
# Header
|
| 398 |
create_header()
|
| 399 |
|
|
|
|
| 9 |
# --- Enhanced Custom Theme ---
|
| 10 |
|
| 11 |
class NordTheme(Base):
|
|
|
|
|
|
|
|
|
|
| 12 |
def __init__(self):
|
| 13 |
super().__init__(
|
| 14 |
primary_hue=colors.blue,
|
|
|
|
| 18 |
font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
|
| 19 |
)
|
| 20 |
self.set(
|
|
|
|
| 21 |
body_background_fill="#2E3440",
|
| 22 |
body_text_color="#ECEFF4",
|
| 23 |
block_background_fill="#3B4252",
|
|
|
|
| 25 |
block_border_color="#4C566A",
|
| 26 |
block_label_background_fill="#434C5E",
|
| 27 |
block_label_text_color="#ECEFF4",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
button_primary_background_fill="#5E81AC",
|
| 29 |
button_primary_background_fill_hover="#81A1C1",
|
| 30 |
button_primary_text_color="#ECEFF4",
|
| 31 |
button_secondary_background_fill="#4C566A",
|
| 32 |
+
button_secondary_background_fill_hover="#5A657A",
|
| 33 |
button_secondary_text_color="#ECEFF4",
|
|
|
|
|
|
|
| 34 |
border_color_accent="#5E81AC",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
block_radius="12px",
|
|
|
|
|
|
|
| 36 |
color_red="#BF616A",
|
| 37 |
color_green="#A3BE8C",
|
| 38 |
color_yellow="#EBCB8B",
|
| 39 |
color_orange="#D08770",
|
| 40 |
)
|
| 41 |
|
| 42 |
+
css_overrides = """
|
| 43 |
+
/* Inputs */
|
| 44 |
+
.gradio-container textarea,
|
| 45 |
+
.gradio-container input[type="text"],
|
| 46 |
+
.gradio-container input[type="password"],
|
| 47 |
+
.gradio-container .code-input {
|
| 48 |
+
background: #434C5E !important;
|
| 49 |
+
color: #ECEFF4 !important;
|
| 50 |
+
border: none !important;
|
| 51 |
+
border-radius: 6px;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
/* Buttons */
|
| 55 |
+
.gradio-container .gr-button.primary {
|
| 56 |
+
background-color: #5E81AC !important;
|
| 57 |
+
color: #ECEFF4 !important;
|
| 58 |
+
}
|
| 59 |
+
.gradio-container .gr-button.primary:hover {
|
| 60 |
+
background-color: #81A1C1 !important;
|
| 61 |
+
}
|
| 62 |
+
.gradio-container .gr-button.secondary {
|
| 63 |
+
background-color: #4C566A !important;
|
| 64 |
+
color: #ECEFF4 !important;
|
| 65 |
+
}
|
| 66 |
+
.gradio-container .gr-button.secondary:hover {
|
| 67 |
+
background-color: #5A657A !important;
|
| 68 |
+
}
|
| 69 |
+
"""
|
| 70 |
+
|
| 71 |
+
|
| 72 |
|
| 73 |
# --- Enhanced Configuration ---
|
| 74 |
|
|
|
|
| 396 |
|
| 397 |
# --- Main Application ---
|
| 398 |
|
| 399 |
+
with gr.Blocks(
|
| 400 |
+
theme=NordTheme(),
|
| 401 |
+
css=css_overrides + """
|
| 402 |
+
.gradio-container {
|
| 403 |
+
max-width: 1200px !important;
|
| 404 |
+
}
|
| 405 |
+
.code-container {
|
| 406 |
+
border-radius: 8px !important;
|
| 407 |
+
}
|
| 408 |
+
""",
|
| 409 |
+
title="CodeVerter Pro"
|
| 410 |
+
) as app:
|
| 411 |
# Header
|
| 412 |
create_header()
|
| 413 |
|