HeshamHaroon Claude Sonnet 4.6 commited on
Commit
61f3e47
Β·
1 Parent(s): f5a0288

feat: cinematic dark theme with pipeline visualizer CSS

Browse files

- MazingerTheme extends gr.themes.Base with amber/teal/studio-gray palettes
- CUSTOM_CSS imports Bricolage Grotesque 200/800/900, IBM Plex Sans, JetBrains Mono
- CSS custom properties: --bg-deep, --bg-surface, --border-subtle, --accent-amber, --accent-teal
- Pipeline node hexagonal clip-path with .active (pulse-amber) and .done (teal) states
- Log area: JetBrains Mono amber-on-near-black terminal aesthetic
- Body/container overrides wired to --bg-deep and IBM Plex Sans

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

Files changed (1) hide show
  1. theme.py +311 -0
theme.py ADDED
@@ -0,0 +1,311 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Mazinger Dubber β€” Cinematic dark theme for Gradio.
3
+ Aesthetic: DaVinci Resolve / Premiere Pro editing suite.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ import gradio as gr
9
+ from gradio.themes.utils import colors
10
+
11
+ # ---------------------------------------------------------------------------
12
+ # Color palettes
13
+ # ---------------------------------------------------------------------------
14
+
15
+ amber = colors.Color(
16
+ name="amber",
17
+ c50="#FFF8E7",
18
+ c100="#FEF0C7",
19
+ c200="#FDD98A",
20
+ c300="#FBC24D",
21
+ c400="#F9AB10",
22
+ c500="#F5A623",
23
+ c600="#D4861A",
24
+ c700="#AA6412",
25
+ c800="#7A440B",
26
+ c900="#4A2905",
27
+ c950="#2A1B05",
28
+ )
29
+
30
+ teal = colors.Color(
31
+ name="teal",
32
+ c50="#ECFDF5",
33
+ c100="#D1FAE5",
34
+ c200="#A7F3D0",
35
+ c300="#6EE7B7",
36
+ c400="#2DD4BF",
37
+ c500="#14B8A6",
38
+ c600="#0D9488",
39
+ c700="#0F766E",
40
+ c800="#115E59",
41
+ c900="#134E4A",
42
+ c950="#042F2E",
43
+ )
44
+
45
+ studio_gray = colors.Color(
46
+ name="studio_gray",
47
+ c50="#E8E8ED",
48
+ c100="#D0D0D8",
49
+ c200="#A8A8B4",
50
+ c300="#7A7A8A",
51
+ c400="#5A5A6A",
52
+ c500="#3A3A48",
53
+ c600="#2A2A36",
54
+ c700="#1E222B",
55
+ c800="#161A21",
56
+ c900="#0D0F12",
57
+ c950="#070809",
58
+ )
59
+
60
+ # ---------------------------------------------------------------------------
61
+ # Custom CSS
62
+ # ---------------------------------------------------------------------------
63
+
64
+ CUSTOM_CSS = """
65
+ @import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@200;800;900&family=IBM+Plex+Sans:wght@400;600&family=JetBrains+Mono:wght@400&display=swap');
66
+
67
+ /* ── Design tokens ─────────────────────────────────────────────────────── */
68
+ :root {
69
+ --bg-deep: #0D0F12;
70
+ --bg-surface: #161A21;
71
+ --border-subtle: rgba(255, 255, 255, 0.06);
72
+ --accent-amber: #F5A623;
73
+ --accent-teal: #2DD4BF;
74
+ --text-primary: #E8E8ED;
75
+ --text-secondary: #8B8D97;
76
+ }
77
+
78
+ /* ── Body / container resets ───────────────────────────────────────────── */
79
+ body,
80
+ .gradio-container {
81
+ background-color: var(--bg-deep) !important;
82
+ font-family: 'IBM Plex Sans', sans-serif !important;
83
+ color: var(--text-primary) !important;
84
+ }
85
+
86
+ /* ── Studio header ─────────────────────────────────────────────────────── */
87
+ .studio-header {
88
+ text-align: center;
89
+ padding: 2.5rem 1rem 1.5rem;
90
+ }
91
+
92
+ .studio-header h1 {
93
+ font-family: 'Bricolage Grotesque', sans-serif;
94
+ font-weight: 900;
95
+ font-size: 3.5rem;
96
+ line-height: 1.05;
97
+ color: var(--text-primary);
98
+ margin: 0 0 0.5rem;
99
+ letter-spacing: -0.01em;
100
+ }
101
+
102
+ .studio-header p {
103
+ font-family: 'IBM Plex Sans', sans-serif;
104
+ font-weight: 400;
105
+ font-size: 1rem;
106
+ color: var(--text-secondary);
107
+ letter-spacing: 0.08em;
108
+ margin: 0;
109
+ text-transform: uppercase;
110
+ }
111
+
112
+ /* ── Card surface ──────────────────────────────────────────────────────── */
113
+ .card-surface {
114
+ background: var(--bg-surface);
115
+ border: 1px solid var(--border-subtle);
116
+ border-radius: 12px;
117
+ padding: 1.5rem;
118
+ }
119
+
120
+ /* ── Primary action button ─────────────────────────────────────────────── */
121
+ .dub-btn,
122
+ .dub-btn button {
123
+ background: var(--accent-amber) !important;
124
+ color: var(--bg-deep) !important;
125
+ font-family: 'Bricolage Grotesque', sans-serif !important;
126
+ font-weight: 800 !important;
127
+ font-size: 1.2rem !important;
128
+ letter-spacing: 0.12em !important;
129
+ border: none !important;
130
+ border-radius: 8px !important;
131
+ padding: 0.85rem 2rem !important;
132
+ cursor: pointer !important;
133
+ transition: box-shadow 0.25s ease, transform 0.15s ease !important;
134
+ text-transform: uppercase !important;
135
+ }
136
+
137
+ .dub-btn:hover,
138
+ .dub-btn button:hover {
139
+ box-shadow: 0 0 24px rgba(245, 166, 35, 0.55),
140
+ 0 0 48px rgba(245, 166, 35, 0.25) !important;
141
+ transform: translateY(-1px) !important;
142
+ }
143
+
144
+ /* ── Pipeline visualizer ───────────────────────────────────────────────── */
145
+ .pipeline-container {
146
+ display: flex;
147
+ align-items: center;
148
+ justify-content: center;
149
+ flex-wrap: wrap;
150
+ gap: 0;
151
+ padding: 1rem 0;
152
+ }
153
+
154
+ .pipeline-node {
155
+ width: 44px;
156
+ height: 50px;
157
+ background: #1E222B;
158
+ clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
159
+ transition: background 0.4s ease, box-shadow 0.4s ease;
160
+ flex-shrink: 0;
161
+ }
162
+
163
+ .pipeline-node.active {
164
+ background: var(--accent-amber);
165
+ animation: pulse-amber 1.6s ease-in-out infinite;
166
+ }
167
+
168
+ .pipeline-node.done {
169
+ background: var(--accent-teal);
170
+ animation: none;
171
+ }
172
+
173
+ .pipeline-connector {
174
+ width: 24px;
175
+ height: 2px;
176
+ background: #1E222B;
177
+ flex-shrink: 0;
178
+ transition: background 0.4s ease;
179
+ }
180
+
181
+ .pipeline-connector.done {
182
+ background: var(--accent-teal);
183
+ }
184
+
185
+ .pipeline-label {
186
+ font-family: 'JetBrains Mono', monospace;
187
+ font-size: 0.6rem;
188
+ color: var(--text-secondary);
189
+ text-align: center;
190
+ margin-top: 0.4rem;
191
+ letter-spacing: 0.04em;
192
+ text-transform: uppercase;
193
+ }
194
+
195
+ /* ── Pulse animation ───────────────────────────────────────────────────── */
196
+ @keyframes pulse-amber {
197
+ 0% { box-shadow: 0 0 0px rgba(245, 166, 35, 0); }
198
+ 50% { box-shadow: 0 0 20px rgba(245, 166, 35, 0.75); }
199
+ 100% { box-shadow: 0 0 0px rgba(245, 166, 35, 0); }
200
+ }
201
+
202
+ /* ── Log area ──────────────────────────────────────────────────────────── */
203
+ .log-area textarea {
204
+ font-family: 'JetBrains Mono', monospace !important;
205
+ font-size: 0.8rem !important;
206
+ color: var(--accent-amber) !important;
207
+ background: #0A0C0F !important;
208
+ border: 1px solid var(--border-subtle) !important;
209
+ border-radius: 6px !important;
210
+ resize: vertical !important;
211
+ }
212
+
213
+ /* ── Studio footer ─────────────────────────────────────────────────────── */
214
+ .studio-footer {
215
+ text-align: center;
216
+ color: var(--text-secondary);
217
+ font-size: 0.8rem;
218
+ padding: 1.5rem 1rem 2rem;
219
+ }
220
+
221
+ .studio-footer a {
222
+ color: var(--accent-amber);
223
+ text-decoration: none;
224
+ }
225
+
226
+ .studio-footer a:hover {
227
+ text-decoration: underline;
228
+ }
229
+ """
230
+
231
+
232
+ # ---------------------------------------------------------------------------
233
+ # Theme class
234
+ # ---------------------------------------------------------------------------
235
+
236
+ class MazingerTheme(gr.themes.Base):
237
+ """
238
+ Cinematic dark Gradio theme for Mazinger Dubber.
239
+ Primary accent: amber (#F5A623).
240
+ Secondary accent: teal (#2DD4BF).
241
+ Neutral: dark studio grays.
242
+ """
243
+
244
+ def __init__(self, **kwargs):
245
+ super().__init__(
246
+ primary_hue=amber,
247
+ secondary_hue=teal,
248
+ neutral_hue=studio_gray,
249
+ font=["IBM Plex Sans", "sans-serif"],
250
+ font_mono=["JetBrains Mono", "monospace"],
251
+ **kwargs,
252
+ )
253
+
254
+ # Surface / background overrides
255
+ self.set(
256
+ body_background_fill="*neutral_900", # --bg-deep (#0D0F12)
257
+ body_background_fill_dark="*neutral_900",
258
+ background_fill_primary="*neutral_800", # --bg-surface (#161A21)
259
+ background_fill_primary_dark="*neutral_800",
260
+ background_fill_secondary="*neutral_900",
261
+ background_fill_secondary_dark="*neutral_900",
262
+
263
+ # Border
264
+ border_color_primary="rgba(255,255,255,0.06)",
265
+ border_color_primary_dark="rgba(255,255,255,0.06)",
266
+
267
+ # Text
268
+ body_text_color="*neutral_50", # #E8E8ED
269
+ body_text_color_dark="*neutral_50",
270
+ body_text_color_subdued="*neutral_300", # #8B8D97-ish
271
+ body_text_color_subdued_dark="*neutral_300",
272
+
273
+ # Buttons β€” primary
274
+ button_primary_background_fill="*primary_500",
275
+ button_primary_background_fill_dark="*primary_500",
276
+ button_primary_background_fill_hover="*primary_400",
277
+ button_primary_background_fill_hover_dark="*primary_400",
278
+ button_primary_text_color="*neutral_950",
279
+ button_primary_text_color_dark="*neutral_950",
280
+
281
+ # Buttons β€” secondary
282
+ button_secondary_background_fill="*neutral_700",
283
+ button_secondary_background_fill_dark="*neutral_700",
284
+ button_secondary_text_color="*neutral_50",
285
+ button_secondary_text_color_dark="*neutral_50",
286
+
287
+ # Inputs
288
+ input_background_fill="*neutral_900",
289
+ input_background_fill_dark="*neutral_900",
290
+ input_border_color="rgba(255,255,255,0.06)",
291
+ input_border_color_dark="rgba(255,255,255,0.06)",
292
+ input_border_color_focus="*primary_500",
293
+ input_border_color_focus_dark="*primary_500",
294
+ input_placeholder_color="*neutral_300",
295
+ input_placeholder_color_dark="*neutral_300",
296
+
297
+ # Block labels
298
+ block_label_text_color="*neutral_300",
299
+ block_label_text_color_dark="*neutral_300",
300
+ block_title_text_color="*neutral_50",
301
+ block_title_text_color_dark="*neutral_50",
302
+
303
+ # Radius
304
+ block_radius="12px",
305
+ button_large_radius="8px",
306
+ input_radius="6px",
307
+
308
+ # Shadow
309
+ block_shadow="0 2px 12px rgba(0,0,0,0.45)",
310
+ block_shadow_dark="0 2px 12px rgba(0,0,0,0.65)",
311
+ )