Skip to content

Commit 3f80e13

Browse files
jeremymanningclaude
andcommitted
style(demos): Update demos 6-10 to match Eliza styling
Apply consistent styling patterns from demo-01-eliza across demos 6-10: Demo 06 (GPT Playground) & Demo 07 (RAG): - Already had correct hero-header structure and theme toggle Demo 08 (Topic Modeling): - Updated HTML to use hero-header > container > hero-title/hero-subtitle pattern - Updated theme toggle JavaScript to use unicode moon/sun icons - Changed back link text from "Back to Demos" to "Home" Demo 09 (Sentiment): - Replaced 7 hardcoded `background: white` with `var(--surface-color)` - Affects: mode-btn, preview-item, contribution-legend, contribution-stats, top-contributors, score-breakdown, dataset-option Demo 10 (POS Tagging): - Replaced ~30 hardcoded colors with CSS variables - Affects: stats-box, stat-item, visualization-box, legend, modal, arc-legend, info-box, badges, and various text colors - Preserved semantic POS/NER category colors (intentionally distinct) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent d860466 commit 3f80e13

File tree

10 files changed

+508
-402
lines changed

10 files changed

+508
-402
lines changed

demos/06-gpt-playground/css/gpt.css

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,16 @@
1-
* {
2-
margin: 0;
3-
padding: 0;
4-
box-sizing: border-box;
5-
}
1+
/**
2+
* GPT Text Generation Playground - Styles
3+
* Uses CSS variables from ../shared/css/demo-styles.css for theming
4+
*/
65

6+
/* Demo-specific variables that don't conflict with theming */
77
:root {
8-
--primary-color: #4f46e5;
9-
--primary-hover: #4338ca;
10-
--secondary-color: #64748b;
11-
--background: #0f172a;
12-
--surface: #1e293b;
13-
--surface-light: #334155;
14-
--text-primary: #f8fafc;
15-
--text-secondary: #cbd5e1;
16-
--border: #475569;
17-
--success: #10b981;
18-
--warning: #f59e0b;
19-
--danger: #ef4444;
8+
--gpt-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
9+
--gpt-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
10+
--gpt-transition: all 0.3s ease;
2011
--token-selected: #818cf8;
2112
--token-alternative: #94a3b8;
22-
}
23-
24-
body {
25-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
26-
background: var(--background);
27-
color: var(--text-primary);
28-
line-height: 1.6;
13+
--primary-hover: #4338ca;
2914
}
3015

3116
.container {
@@ -34,25 +19,29 @@ body {
3419
padding: 20px;
3520
}
3621

37-
header {
38-
text-align: center;
22+
/* Hero Header - matches ELIZA demo styling */
23+
.hero-header {
24+
padding: 3rem 0 2rem;
3925
margin-bottom: 30px;
40-
padding: 30px 0;
41-
border-bottom: 2px solid var(--border);
26+
text-align: center;
27+
background: linear-gradient(180deg, var(--surface-color) 0%, var(--bg-color) 100%);
4228
}
4329

44-
h1 {
45-
font-size: 2.5rem;
46-
margin-bottom: 10px;
47-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
30+
.hero-title {
31+
font-size: clamp(2rem, 4vw, 3rem);
32+
font-weight: 800;
33+
margin-bottom: 1rem;
34+
background: var(--gradient-primary);
4835
-webkit-background-clip: text;
49-
-webkit-text-fill-color: transparent;
5036
background-clip: text;
37+
-webkit-text-fill-color: transparent;
5138
}
5239

53-
.subtitle {
40+
.hero-subtitle {
41+
font-size: clamp(1rem, 2vw, 1.25rem);
5442
color: var(--text-secondary);
55-
font-size: 1.1rem;
43+
max-width: 600px;
44+
margin: 0 auto;
5645
}
5746

5847
.model-status {
@@ -64,15 +53,15 @@ h1 {
6453
align-items: center;
6554
justify-content: center;
6655
padding: 15px;
67-
background: var(--surface);
56+
background: var(--surface-color);
6857
border-radius: 8px;
6958
gap: 10px;
7059
}
7160

7261
.spinner {
7362
width: 20px;
7463
height: 20px;
75-
border: 3px solid var(--border);
64+
border: 3px solid var(--border-color);
7665
border-top-color: var(--primary-color);
7766
border-radius: 50%;
7867
animation: spin 1s linear infinite;
@@ -96,18 +85,20 @@ h1 {
9685

9786
/* Controls Panel */
9887
.controls-panel {
99-
background: var(--surface);
88+
background: var(--surface-color);
10089
border-radius: 12px;
10190
padding: 20px;
10291
height: fit-content;
10392
max-height: calc(100vh - 200px);
10493
overflow-y: auto;
94+
border: 1px solid var(--border-color);
95+
box-shadow: var(--gpt-shadow);
10596
}
10697

10798
.control-section {
10899
margin-bottom: 25px;
109100
padding-bottom: 25px;
110-
border-bottom: 1px solid var(--border);
101+
border-bottom: 1px solid var(--border-color);
111102
}
112103

113104
.control-section:last-child {
@@ -144,8 +135,8 @@ h1 {
144135
select, textarea {
145136
width: 100%;
146137
padding: 10px;
147-
background: var(--surface-light);
148-
border: 1px solid var(--border);
138+
background: var(--surface-hover);
139+
border: 1px solid var(--border-color);
149140
border-radius: 6px;
150141
color: var(--text-primary);
151142
font-size: 0.95rem;
@@ -165,7 +156,7 @@ select:focus, textarea:focus {
165156
input[type="range"] {
166157
width: 100%;
167158
height: 6px;
168-
background: var(--surface-light);
159+
background: var(--surface-hover);
169160
border-radius: 3px;
170161
outline: none;
171162
-webkit-appearance: none;
@@ -231,12 +222,12 @@ button {
231222
}
232223

233224
.btn-secondary {
234-
background: var(--surface-light);
225+
background: var(--surface-hover);
235226
color: var(--text-primary);
236227
}
237228

238229
.btn-secondary:hover:not(:disabled) {
239-
background: var(--border);
230+
background: var(--border-color);
240231
}
241232

242233
button:disabled {
@@ -246,9 +237,11 @@ button:disabled {
246237

247238
/* Output Panel */
248239
.output-panel {
249-
background: var(--surface);
240+
background: var(--surface-color);
250241
border-radius: 12px;
251242
padding: 20px;
243+
border: 1px solid var(--border-color);
244+
box-shadow: var(--gpt-shadow);
252245
}
253246

254247
.output-section {
@@ -262,8 +255,8 @@ button:disabled {
262255
}
263256

264257
.generated-text {
265-
background: var(--surface-light);
266-
border: 1px solid var(--border);
258+
background: var(--bg-secondary);
259+
border: 1px solid var(--border-color);
267260
border-radius: 8px;
268261
padding: 20px;
269262
min-height: 150px;
@@ -296,20 +289,20 @@ button:disabled {
296289
}
297290

298291
.token.high-surprise {
299-
border-bottom: 2px solid var(--warning);
292+
border-bottom: 2px solid var(--warning-color);
300293
}
301294

302295
.token.very-high-surprise {
303-
border-bottom: 2px solid var(--danger);
296+
border-bottom: 2px solid var(--error-color);
304297
}
305298

306299
.token-tooltip {
307300
position: absolute;
308301
bottom: 100%;
309302
left: 50%;
310303
transform: translateX(-50%);
311-
background: var(--surface-light);
312-
border: 1px solid var(--border);
304+
background: var(--surface-hover);
305+
border: 1px solid var(--border-color);
313306
border-radius: 6px;
314307
padding: 8px 12px;
315308
white-space: nowrap;
@@ -332,10 +325,10 @@ button:disabled {
332325
}
333326

334327
.stat-item {
335-
background: var(--surface-light);
328+
background: var(--surface-hover);
336329
padding: 15px;
337330
border-radius: 8px;
338-
border: 1px solid var(--border);
331+
border: 1px solid var(--border-color);
339332
}
340333

341334
.stat-label {

demos/06-gpt-playground/index.html

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
</head>
1010
<body>
1111
<nav class="demo-nav">
12-
<a href="../" class="back-link">← Back to Demos</a>
13-
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">☀️</button>
12+
<a href="../" class="back-link">← Home</a>
13+
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle theme">
14+
<span id="theme-icon">&#127769;</span>
15+
</button>
1416
</nav>
17+
<div class="hero-header">
18+
<div class="container">
19+
<h1 class="hero-title">GPT Text Generation Playground</h1>
20+
<p class="hero-subtitle">Explore different sampling strategies and visualize the generation process</p>
21+
</div>
22+
</div>
1523
<div class="container">
16-
<header>
17-
<h1>GPT Text Generation Playground</h1>
18-
<p class="subtitle">Explore different sampling strategies and visualize the generation process</p>
19-
</header>
2024

2125
<div class="model-status">
2226
<div id="loadingIndicator" class="loading">
@@ -243,15 +247,21 @@ <h3>Strategy B: <span id="strategyBName">Temperature</span></h3>
243247
<script type="module" src="js/text-generator.js"></script>
244248

245249
<script>
246-
// Theme toggle functionality
250+
// Theme toggle functionality (synced with main index via localStorage)
247251
const themeToggle = document.getElementById('theme-toggle');
252+
const themeIcon = document.getElementById('theme-icon');
248253
const html = document.documentElement;
249254

250-
// Load saved theme
255+
// Load saved theme from localStorage
251256
const savedTheme = localStorage.getItem('theme') || 'dark';
252257
html.setAttribute('data-theme', savedTheme);
253-
if (themeToggle) {
254-
themeToggle.textContent = savedTheme === 'dark' ? '☀️' : '🌙';
258+
updateThemeIcon(savedTheme);
259+
260+
function updateThemeIcon(theme) {
261+
// Using the same icons as ELIZA demo (moon/sun HTML entities)
262+
if (themeIcon) {
263+
themeIcon.textContent = theme === 'dark' ? '\u{1F319}' : '\u2600\uFE0F';
264+
}
255265
}
256266

257267
if (themeToggle) {
@@ -260,7 +270,7 @@ <h3>Strategy B: <span id="strategyBName">Temperature</span></h3>
260270
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
261271
html.setAttribute('data-theme', newTheme);
262272
localStorage.setItem('theme', newTheme);
263-
themeToggle.textContent = newTheme === 'dark' ? '☀️' : '🌙';
273+
updateThemeIcon(newTheme);
264274
});
265275
}
266276
</script>

0 commit comments

Comments
 (0)