cheikhaidev-ui Claude Sonnet 4.6 commited on
Commit
b458af3
·
1 Parent(s): 6a855ca

style(app): thème custom dark indigo/violet via gr.themes.Base()

Browse files

- Palette primaire #6366f1 (indigo), secondaire purple, neutre slate
- Mode dark forcé au chargement via JS classList.add('dark')
- Police Inter (Google Fonts) + system-ui en fallback
- Couleurs détaillées : fonds #0f0f1a/#1e1e2e, boutons, inputs, sliders

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +50 -4
app.py CHANGED
@@ -90,7 +90,6 @@ def _render_clarity(lines: list[str], spch: dict) -> str:
90
 
91
 
92
  def _polarity_bar(polarity: float) -> str:
93
- """Barre textuelle [-1 … +1] avec curseur."""
94
  pos = int((polarity + 1) / 2 * 20)
95
  pos = max(0, min(20, pos))
96
  bar = "─" * pos + "●" + "─" * (20 - pos)
@@ -98,7 +97,6 @@ def _polarity_bar(polarity: float) -> str:
98
 
99
 
100
  def _score_bar(score: int) -> str:
101
- """Barre de progression 0-100."""
102
  filled = int(score / 100 * 20)
103
  bar = "█" * filled + "░" * (20 - filled)
104
  return f"`{bar}` **{score}/100**"
@@ -122,7 +120,55 @@ EXAMPLE_EN = (
122
  "In conclusion, we must act now to protect future generations."
123
  )
124
 
125
- with gr.Blocks(title="LinguaScope") as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
 
127
  gr.Markdown("# LinguaScope\nAnalyse de sentiment et de discours — FR & EN")
128
 
@@ -168,4 +214,4 @@ with gr.Blocks(title="LinguaScope") as demo:
168
 
169
 
170
  if __name__ == "__main__":
171
- demo.launch(theme=gr.themes.Soft())
 
90
 
91
 
92
  def _polarity_bar(polarity: float) -> str:
 
93
  pos = int((polarity + 1) / 2 * 20)
94
  pos = max(0, min(20, pos))
95
  bar = "─" * pos + "●" + "─" * (20 - pos)
 
97
 
98
 
99
  def _score_bar(score: int) -> str:
 
100
  filled = int(score / 100 * 20)
101
  bar = "█" * filled + "░" * (20 - filled)
102
  return f"`{bar}` **{score}/100**"
 
120
  "In conclusion, we must act now to protect future generations."
121
  )
122
 
123
+ THEME = gr.themes.Base(
124
+ primary_hue=gr.themes.colors.indigo,
125
+ secondary_hue=gr.themes.colors.purple,
126
+ neutral_hue=gr.themes.colors.slate,
127
+ font=[gr.themes.GoogleFont("Inter"), "system-ui", "sans-serif"],
128
+ ).set(
129
+ body_background_fill="#0f0f1a",
130
+ body_background_fill_dark="#0f0f1a",
131
+ body_text_color="#e2e8f0",
132
+ body_text_color_dark="#e2e8f0",
133
+ body_text_color_subdued="#94a3b8",
134
+ body_text_color_subdued_dark="#94a3b8",
135
+ block_background_fill="#1e1e2e",
136
+ block_background_fill_dark="#1e1e2e",
137
+ block_border_color="#2d2d44",
138
+ block_border_color_dark="#2d2d44",
139
+ block_label_text_color="#a5b4fc",
140
+ block_label_text_color_dark="#a5b4fc",
141
+ block_title_text_color="#c7d2fe",
142
+ block_title_text_color_dark="#c7d2fe",
143
+ button_primary_background_fill="#6366f1",
144
+ button_primary_background_fill_dark="#6366f1",
145
+ button_primary_background_fill_hover="#4f46e5",
146
+ button_primary_background_fill_hover_dark="#4f46e5",
147
+ button_primary_text_color="#ffffff",
148
+ button_primary_text_color_dark="#ffffff",
149
+ button_secondary_background_fill="#1e1e2e",
150
+ button_secondary_background_fill_dark="#1e1e2e",
151
+ button_secondary_background_fill_hover="#2d2d44",
152
+ button_secondary_background_fill_hover_dark="#2d2d44",
153
+ button_secondary_border_color="#3d3d5c",
154
+ button_secondary_border_color_dark="#3d3d5c",
155
+ button_secondary_text_color="#a5b4fc",
156
+ button_secondary_text_color_dark="#a5b4fc",
157
+ input_background_fill="#13131f",
158
+ input_background_fill_dark="#13131f",
159
+ input_border_color="#2d2d44",
160
+ input_border_color_dark="#2d2d44",
161
+ input_border_color_focus="#6366f1",
162
+ input_border_color_focus_dark="#6366f1",
163
+ input_placeholder_color="#475569",
164
+ input_placeholder_color_dark="#475569",
165
+ slider_color="#6366f1",
166
+ slider_color_dark="#6366f1",
167
+ )
168
+
169
+ _DARK_JS = "() => { document.documentElement.classList.add('dark'); }"
170
+
171
+ with gr.Blocks(title="LinguaScope", js=_DARK_JS) as demo:
172
 
173
  gr.Markdown("# LinguaScope\nAnalyse de sentiment et de discours — FR & EN")
174
 
 
214
 
215
 
216
  if __name__ == "__main__":
217
+ demo.launch(theme=THEME)