Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,17 +16,17 @@ class NordTheme(Base):
|
|
| 16 |
font=(fonts.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"),
|
| 17 |
font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
|
| 18 |
)
|
|
|
|
| 19 |
self.set(
|
| 20 |
-
# backgrounds & text
|
| 21 |
body_background_fill="#2E3440",
|
| 22 |
body_text_color="#ECEFF4",
|
|
|
|
| 23 |
block_background_fill="#3B4252",
|
| 24 |
-
block_border_color="#4C566A",
|
| 25 |
block_border_width="1px",
|
|
|
|
| 26 |
block_label_background_fill="#434C5E",
|
| 27 |
block_label_text_color="#ECEFF4",
|
| 28 |
|
| 29 |
-
# buttons
|
| 30 |
button_primary_background_fill="#5E81AC",
|
| 31 |
button_primary_background_fill_hover="#81A1C1",
|
| 32 |
button_primary_text_color="#ECEFF4",
|
|
@@ -34,48 +34,56 @@ class NordTheme(Base):
|
|
| 34 |
button_secondary_background_fill_hover="#5A657A",
|
| 35 |
button_secondary_text_color="#ECEFF4",
|
| 36 |
|
| 37 |
-
# accents & radius
|
| 38 |
border_color_accent="#5E81AC",
|
| 39 |
block_radius="12px",
|
| 40 |
-
|
| 41 |
-
# alert colors (use the correct token names)
|
| 42 |
-
color_error="#BF616A",
|
| 43 |
-
color_success="#A3BE8C",
|
| 44 |
-
color_warning="#EBCB8B",
|
| 45 |
)
|
| 46 |
|
| 47 |
|
|
|
|
| 48 |
css_overrides = """
|
| 49 |
/* Inputs */
|
| 50 |
-
.gradio-container textarea,
|
| 51 |
.gradio-container input[type="text"],
|
| 52 |
.gradio-container input[type="password"],
|
| 53 |
.gradio-container .code-input {
|
| 54 |
background: #434C5E !important;
|
| 55 |
color: #ECEFF4 !important;
|
| 56 |
border: none !important;
|
| 57 |
-
border-radius: 6px;
|
| 58 |
}
|
| 59 |
|
| 60 |
-
/*
|
| 61 |
-
.gradio-container .gr-
|
| 62 |
-
background-color: #
|
| 63 |
-
color:
|
| 64 |
}
|
| 65 |
-
.gradio-container .gr-
|
| 66 |
-
background-color: #
|
|
|
|
| 67 |
}
|
| 68 |
-
.gradio-container .gr-
|
| 69 |
-
background-color: #
|
| 70 |
-
color:
|
| 71 |
}
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
"""
|
| 76 |
|
| 77 |
|
| 78 |
|
|
|
|
| 79 |
# --- Enhanced Configuration ---
|
| 80 |
|
| 81 |
PROGRAMMING_LANGUAGES = sorted([
|
|
@@ -404,14 +412,7 @@ def create_footer():
|
|
| 404 |
|
| 405 |
with gr.Blocks(
|
| 406 |
theme=NordTheme(),
|
| 407 |
-
css=css_overrides
|
| 408 |
-
.gradio-container {
|
| 409 |
-
max-width: 1200px !important;
|
| 410 |
-
}
|
| 411 |
-
.code-container {
|
| 412 |
-
border-radius: 8px !important;
|
| 413 |
-
}
|
| 414 |
-
""",
|
| 415 |
title="CodeVerter Pro"
|
| 416 |
) as app:
|
| 417 |
# Header
|
|
|
|
| 16 |
font=(fonts.GoogleFont("Inter"), "ui-sans-serif", "system-ui", "sans-serif"),
|
| 17 |
font_mono=(fonts.GoogleFont("Fira Code"), "ui-monospace", "monospace"),
|
| 18 |
)
|
| 19 |
+
# only the supported tokens
|
| 20 |
self.set(
|
|
|
|
| 21 |
body_background_fill="#2E3440",
|
| 22 |
body_text_color="#ECEFF4",
|
| 23 |
+
|
| 24 |
block_background_fill="#3B4252",
|
|
|
|
| 25 |
block_border_width="1px",
|
| 26 |
+
block_border_color="#4C566A",
|
| 27 |
block_label_background_fill="#434C5E",
|
| 28 |
block_label_text_color="#ECEFF4",
|
| 29 |
|
|
|
|
| 30 |
button_primary_background_fill="#5E81AC",
|
| 31 |
button_primary_background_fill_hover="#81A1C1",
|
| 32 |
button_primary_text_color="#ECEFF4",
|
|
|
|
| 34 |
button_secondary_background_fill_hover="#5A657A",
|
| 35 |
button_secondary_text_color="#ECEFF4",
|
| 36 |
|
|
|
|
| 37 |
border_color_accent="#5E81AC",
|
| 38 |
block_radius="12px",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
)
|
| 40 |
|
| 41 |
|
| 42 |
+
# your CSS overrides, combining everything:
|
| 43 |
css_overrides = """
|
| 44 |
/* Inputs */
|
| 45 |
+
.gradio-container textarea,
|
| 46 |
.gradio-container input[type="text"],
|
| 47 |
.gradio-container input[type="password"],
|
| 48 |
.gradio-container .code-input {
|
| 49 |
background: #434C5E !important;
|
| 50 |
color: #ECEFF4 !important;
|
| 51 |
border: none !important;
|
| 52 |
+
border-radius: 6px !important;
|
| 53 |
}
|
| 54 |
|
| 55 |
+
/* Alerts */
|
| 56 |
+
.gradio-container .gr-alert-error {
|
| 57 |
+
background-color: #BF616A !important;
|
| 58 |
+
color: white !important;
|
| 59 |
}
|
| 60 |
+
.gradio-container .gr-alert-success {
|
| 61 |
+
background-color: #A3BE8C !important;
|
| 62 |
+
color: white !important;
|
| 63 |
}
|
| 64 |
+
.gradio-container .gr-alert-warning {
|
| 65 |
+
background-color: #EBCB8B !important;
|
| 66 |
+
color: black !important;
|
| 67 |
}
|
| 68 |
+
|
| 69 |
+
/* Orange “custom” alert */
|
| 70 |
+
.gradio-container .gr-alert-orange {
|
| 71 |
+
background-color: #D08770 !important;
|
| 72 |
+
color: white !important;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
/* Layout tweaks */
|
| 76 |
+
.gradio-container {
|
| 77 |
+
max-width: 1200px !important;
|
| 78 |
+
}
|
| 79 |
+
.code-container {
|
| 80 |
+
border-radius: 8px !important;
|
| 81 |
}
|
| 82 |
"""
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
+
|
| 87 |
# --- Enhanced Configuration ---
|
| 88 |
|
| 89 |
PROGRAMMING_LANGUAGES = sorted([
|
|
|
|
| 412 |
|
| 413 |
with gr.Blocks(
|
| 414 |
theme=NordTheme(),
|
| 415 |
+
css=css_overrides,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
title="CodeVerter Pro"
|
| 417 |
) as app:
|
| 418 |
# Header
|