Spaces:
Running
Running
cheikhaidev-ui Claude Sonnet 4.6 commited on
Commit ·
76aefa2
1
Parent(s): b458af3
style(app): CSS custom — cards, header impactant, hover boutons
Browse files- Header gradient indigo avec titre dégradé et sous-titre en caps
- Cards résultats : border-radius 12px, box-shadow, glow indigo au hover
- Card Synthèse accentuée (bordure + ombre indigo plus marquées)
- Boutons : coins arrondis, translateY au hover, glow sur le primaire
- Container max-width 1300px, espacement cohérent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
app.py
CHANGED
|
@@ -168,9 +168,100 @@ THEME = gr.themes.Base(
|
|
| 168 |
|
| 169 |
_DARK_JS = "() => { document.documentElement.classList.add('dark'); }"
|
| 170 |
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
|
| 175 |
with gr.Row():
|
| 176 |
with gr.Column(scale=2):
|
|
@@ -185,8 +276,10 @@ with gr.Blocks(title="LinguaScope", js=_DARK_JS) as demo:
|
|
| 185 |
label="Langue",
|
| 186 |
)
|
| 187 |
with gr.Row():
|
| 188 |
-
submit_btn = gr.Button("Analyser", variant="primary"
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
|
| 191 |
gr.Examples(
|
| 192 |
examples=[[EXAMPLE_FR, "Français"], [EXAMPLE_EN, "Anglais"]],
|
|
@@ -194,14 +287,14 @@ with gr.Blocks(title="LinguaScope", js=_DARK_JS) as demo:
|
|
| 194 |
label="Exemples",
|
| 195 |
)
|
| 196 |
|
| 197 |
-
with gr.Column(scale=3):
|
| 198 |
-
out_summary = gr.Markdown()
|
| 199 |
with gr.Row():
|
| 200 |
-
out_sentiment = gr.Markdown()
|
| 201 |
-
out_speech = gr.Markdown()
|
| 202 |
with gr.Row():
|
| 203 |
-
out_structure = gr.Markdown()
|
| 204 |
-
out_clarity = gr.Markdown()
|
| 205 |
|
| 206 |
outputs = [out_summary, out_sentiment, out_speech, out_structure, out_clarity]
|
| 207 |
|
|
|
|
| 168 |
|
| 169 |
_DARK_JS = "() => { document.documentElement.classList.add('dark'); }"
|
| 170 |
|
| 171 |
+
CSS = """
|
| 172 |
+
/* ── Header ───────────────────────────────────────────────────────── */
|
| 173 |
+
#ls-header {
|
| 174 |
+
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #1e1b4b 100%);
|
| 175 |
+
border: 1px solid #3730a3;
|
| 176 |
+
border-radius: 16px;
|
| 177 |
+
padding: 2rem 2rem 1.75rem;
|
| 178 |
+
text-align: center;
|
| 179 |
+
box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
|
| 180 |
+
margin-bottom: 1.75rem;
|
| 181 |
+
}
|
| 182 |
+
|
| 183 |
+
#ls-header .ls-logo { font-size: 3rem; line-height: 1; margin-bottom: 0.4rem; }
|
| 184 |
+
|
| 185 |
+
#ls-header h1 {
|
| 186 |
+
font-size: 2.4rem !important;
|
| 187 |
+
font-weight: 800 !important;
|
| 188 |
+
background: linear-gradient(135deg, #c7d2fe, #a5b4fc, #818cf8);
|
| 189 |
+
-webkit-background-clip: text;
|
| 190 |
+
-webkit-text-fill-color: transparent;
|
| 191 |
+
background-clip: text;
|
| 192 |
+
margin: 0.2rem 0 !important;
|
| 193 |
+
letter-spacing: -0.03em;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
#ls-header p.ls-subtitle {
|
| 197 |
+
color: #94a3b8 !important;
|
| 198 |
+
font-size: 0.95rem !important;
|
| 199 |
+
margin: 0.5rem 0 0 !important;
|
| 200 |
+
letter-spacing: 0.06em;
|
| 201 |
+
text-transform: uppercase;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
/* ── Result cards ─────────────────────────────────────────────────── */
|
| 205 |
+
.ls-card {
|
| 206 |
+
border-radius: 12px !important;
|
| 207 |
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
|
| 208 |
+
transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
.ls-card:hover {
|
| 212 |
+
box-shadow: 0 6px 30px rgba(99, 102, 241, 0.18) !important;
|
| 213 |
+
border-color: #4338ca !important;
|
| 214 |
+
}
|
| 215 |
+
|
| 216 |
+
.ls-summary {
|
| 217 |
+
border-color: #4338ca !important;
|
| 218 |
+
box-shadow: 0 4px 28px rgba(99, 102, 241, 0.28) !important;
|
| 219 |
+
border-radius: 12px !important;
|
| 220 |
+
margin-bottom: 1rem !important;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
/* ── Buttons ──────────────────────────────────────────────────────── */
|
| 224 |
+
.ls-btn-primary > button {
|
| 225 |
+
border-radius: 8px !important;
|
| 226 |
+
font-weight: 600 !important;
|
| 227 |
+
letter-spacing: 0.04em !important;
|
| 228 |
+
box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4) !important;
|
| 229 |
+
transition: transform 0.15s ease, box-shadow 0.15s ease !important;
|
| 230 |
+
}
|
| 231 |
+
|
| 232 |
+
.ls-btn-primary > button:hover {
|
| 233 |
+
transform: translateY(-2px) !important;
|
| 234 |
+
box-shadow: 0 6px 22px rgba(99, 102, 241, 0.6) !important;
|
| 235 |
+
}
|
| 236 |
+
|
| 237 |
+
.ls-btn-primary > button:active { transform: translateY(0) !important; }
|
| 238 |
+
|
| 239 |
+
.ls-btn-secondary > button {
|
| 240 |
+
border-radius: 8px !important;
|
| 241 |
+
transition: transform 0.15s ease, border-color 0.15s ease !important;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
.ls-btn-secondary > button:hover {
|
| 245 |
+
transform: translateY(-1px) !important;
|
| 246 |
+
border-color: #6366f1 !important;
|
| 247 |
+
color: #a5b4fc !important;
|
| 248 |
+
}
|
| 249 |
+
|
| 250 |
+
/* ── Container & spacing ──────────────────────────────────────────── */
|
| 251 |
+
.gradio-container { max-width: 1300px !important; padding: 1.5rem 2rem !important; }
|
| 252 |
+
|
| 253 |
+
.ls-results-col { gap: 0.85rem !important; }
|
| 254 |
+
"""
|
| 255 |
+
|
| 256 |
+
_HEADER_MD = """<div class="ls-logo">🔭</div>
|
| 257 |
+
|
| 258 |
+
# LinguaScope
|
| 259 |
+
|
| 260 |
+
<p class="ls-subtitle">Analyse de sentiment et de discours — FR & EN</p>"""
|
| 261 |
+
|
| 262 |
+
with gr.Blocks(title="LinguaScope", js=_DARK_JS, css=CSS) as demo:
|
| 263 |
+
|
| 264 |
+
gr.Markdown(_HEADER_MD, elem_id="ls-header")
|
| 265 |
|
| 266 |
with gr.Row():
|
| 267 |
with gr.Column(scale=2):
|
|
|
|
| 276 |
label="Langue",
|
| 277 |
)
|
| 278 |
with gr.Row():
|
| 279 |
+
submit_btn = gr.Button("Analyser", variant="primary",
|
| 280 |
+
elem_classes=["ls-btn-primary"])
|
| 281 |
+
clear_btn = gr.Button("Effacer",
|
| 282 |
+
elem_classes=["ls-btn-secondary"])
|
| 283 |
|
| 284 |
gr.Examples(
|
| 285 |
examples=[[EXAMPLE_FR, "Français"], [EXAMPLE_EN, "Anglais"]],
|
|
|
|
| 287 |
label="Exemples",
|
| 288 |
)
|
| 289 |
|
| 290 |
+
with gr.Column(scale=3, elem_classes=["ls-results-col"]):
|
| 291 |
+
out_summary = gr.Markdown(elem_classes=["ls-summary"])
|
| 292 |
with gr.Row():
|
| 293 |
+
out_sentiment = gr.Markdown(elem_classes=["ls-card"])
|
| 294 |
+
out_speech = gr.Markdown(elem_classes=["ls-card"])
|
| 295 |
with gr.Row():
|
| 296 |
+
out_structure = gr.Markdown(elem_classes=["ls-card"])
|
| 297 |
+
out_clarity = gr.Markdown(elem_classes=["ls-card"])
|
| 298 |
|
| 299 |
outputs = [out_summary, out_sentiment, out_speech, out_structure, out_clarity]
|
| 300 |
|