icebear0828 Claude Opus 4.6 commited on
Commit
35ed5a4
·
1 Parent(s): 8fc11c2

ui: tighten font sizes, add Anthropic & Gemini code examples

Browse files

Reduce code block font from 0.82rem to 0.75rem with tighter line-height,
switch to SF Mono/Cascadia Code fonts, shrink all UI element font sizes
for a more compact look. Add Anthropic SDK and Gemini curl examples
to the Integration Examples tabs.

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

Files changed (1) hide show
  1. public/dashboard.html +81 -31
public/dashboard.html CHANGED
@@ -46,7 +46,7 @@
46
  color: #6b7280;
47
  }
48
  .topnav-title {
49
- font-size: 1rem;
50
  font-weight: 600;
51
  color: #111827;
52
  }
@@ -76,12 +76,12 @@
76
  display: inline-flex;
77
  align-items: center;
78
  gap: 0.4rem;
79
- padding: 7px 16px;
80
  background: #10a37f;
81
  color: #fff;
82
  border: none;
83
  border-radius: 8px;
84
- font-size: 0.85rem;
85
  font-weight: 500;
86
  font-family: inherit;
87
  cursor: pointer;
@@ -99,10 +99,10 @@
99
 
100
  /* Section headings */
101
  .section-title {
102
- font-size: 1.1rem;
103
  font-weight: 600;
104
  color: #111827;
105
- margin-bottom: 1rem;
106
  }
107
 
108
  /* Accounts */
@@ -116,8 +116,8 @@
116
  background: #fff;
117
  border: 1px solid #e5e7eb;
118
  border-radius: 12px;
119
- padding: 1.25rem;
120
- min-width: 280px;
121
  flex: 1;
122
  position: relative;
123
  }
@@ -128,13 +128,13 @@
128
  margin-bottom: 1rem;
129
  }
130
  .avatar {
131
- width: 40px;
132
- height: 40px;
133
  border-radius: 50%;
134
  display: flex;
135
  align-items: center;
136
  justify-content: center;
137
- font-size: 1rem;
138
  font-weight: 600;
139
  color: #fff;
140
  flex-shrink: 0;
@@ -146,7 +146,7 @@
146
  .avatar-red { background: #ef4444; }
147
  .account-info { flex: 1; min-width: 0; }
148
  .account-email {
149
- font-size: 0.9rem;
150
  font-weight: 600;
151
  color: #111827;
152
  white-space: nowrap;
@@ -154,7 +154,7 @@
154
  text-overflow: ellipsis;
155
  }
156
  .account-plan {
157
- font-size: 0.8rem;
158
  color: #6b7280;
159
  }
160
  .status-badge {
@@ -185,7 +185,7 @@
185
  margin-bottom: 2px;
186
  }
187
  .stat-value {
188
- font-size: 1rem;
189
  font-weight: 600;
190
  color: #111827;
191
  }
@@ -279,11 +279,11 @@
279
  background: #fff;
280
  border: 1px solid #e5e7eb;
281
  border-radius: 12px;
282
- padding: 1.5rem;
283
- margin-bottom: 2rem;
284
  }
285
  .config-card .card-subtitle {
286
- font-size: 0.82rem;
287
  color: #6b7280;
288
  margin-bottom: 1.25rem;
289
  }
@@ -307,12 +307,12 @@
307
  }
308
  .config-value .val {
309
  flex: 1;
310
- padding: 9px 12px;
311
  background: #f9fafb;
312
  border: 1px solid #e5e7eb;
313
  border-radius: 8px;
314
- font-family: 'Inter', monospace;
315
- font-size: 0.85rem;
316
  color: #111827;
317
  white-space: nowrap;
318
  overflow: hidden;
@@ -419,8 +419,8 @@
419
  background: #fff;
420
  border: 1px solid #e5e7eb;
421
  border-radius: 12px;
422
- padding: 1.5rem;
423
- margin-bottom: 2rem;
424
  }
425
  .tabs {
426
  display: flex;
@@ -429,12 +429,12 @@
429
  margin-bottom: 1rem;
430
  }
431
  .tab {
432
- padding: 8px 16px;
433
  background: none;
434
  border: none;
435
  border-bottom: 2px solid transparent;
436
  color: #6b7280;
437
- font-size: 0.85rem;
438
  font-family: inherit;
439
  cursor: pointer;
440
  transition: all 0.2s;
@@ -448,10 +448,10 @@
448
  .code-block {
449
  background: #1e1e1e;
450
  border-radius: 10px;
451
- padding: 1.25rem;
452
- font-family: 'Courier New', Courier, monospace;
453
- font-size: 0.82rem;
454
- line-height: 1.7;
455
  color: #d4d4d4;
456
  overflow-x: auto;
457
  white-space: pre;
@@ -585,18 +585,28 @@
585
  <button class="tab active" onclick="switchTab('python', this)">Python</button>
586
  <button class="tab" onclick="switchTab('curl', this)">cURL</button>
587
  <button class="tab" onclick="switchTab('node', this)">Node.js</button>
 
 
588
  </div>
589
  <div class="tab-content active" id="tab-python">
590
  <div class="code-block" id="code-python">Loading...
591
- <button class="copy-code-btn" onclick="copyCode('code-python')">&#9112; Copy Code</button></div>
592
  </div>
593
  <div class="tab-content" id="tab-curl">
594
  <div class="code-block" id="code-curl">Loading...
595
- <button class="copy-code-btn" onclick="copyCode('code-curl')">&#9112; Copy Code</button></div>
596
  </div>
597
  <div class="tab-content" id="tab-node">
598
  <div class="code-block" id="code-node">Loading...
599
- <button class="copy-code-btn" onclick="copyCode('code-node')">&#9112; Copy Code</button></div>
 
 
 
 
 
 
 
 
600
  </div>
601
  </div>
602
  </div>
@@ -856,7 +866,47 @@ const stream = await client.chat.completions.create({
856
  for await (const chunk of stream) {
857
  process.stdout.write(chunk.choices[0]?.delta?.content || "");
858
  }
859
- <button class="copy-code-btn" onclick="copyCode('code-node')">&#9112; Copy Code</button>`;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
860
  }
861
 
862
  function saveOverrides() {
 
46
  color: #6b7280;
47
  }
48
  .topnav-title {
49
+ font-size: 0.9rem;
50
  font-weight: 600;
51
  color: #111827;
52
  }
 
76
  display: inline-flex;
77
  align-items: center;
78
  gap: 0.4rem;
79
+ padding: 6px 14px;
80
  background: #10a37f;
81
  color: #fff;
82
  border: none;
83
  border-radius: 8px;
84
+ font-size: 0.78rem;
85
  font-weight: 500;
86
  font-family: inherit;
87
  cursor: pointer;
 
99
 
100
  /* Section headings */
101
  .section-title {
102
+ font-size: 0.95rem;
103
  font-weight: 600;
104
  color: #111827;
105
+ margin-bottom: 0.75rem;
106
  }
107
 
108
  /* Accounts */
 
116
  background: #fff;
117
  border: 1px solid #e5e7eb;
118
  border-radius: 12px;
119
+ padding: 1rem;
120
+ min-width: 260px;
121
  flex: 1;
122
  position: relative;
123
  }
 
128
  margin-bottom: 1rem;
129
  }
130
  .avatar {
131
+ width: 34px;
132
+ height: 34px;
133
  border-radius: 50%;
134
  display: flex;
135
  align-items: center;
136
  justify-content: center;
137
+ font-size: 0.85rem;
138
  font-weight: 600;
139
  color: #fff;
140
  flex-shrink: 0;
 
146
  .avatar-red { background: #ef4444; }
147
  .account-info { flex: 1; min-width: 0; }
148
  .account-email {
149
+ font-size: 0.82rem;
150
  font-weight: 600;
151
  color: #111827;
152
  white-space: nowrap;
 
154
  text-overflow: ellipsis;
155
  }
156
  .account-plan {
157
+ font-size: 0.75rem;
158
  color: #6b7280;
159
  }
160
  .status-badge {
 
185
  margin-bottom: 2px;
186
  }
187
  .stat-value {
188
+ font-size: 0.85rem;
189
  font-weight: 600;
190
  color: #111827;
191
  }
 
279
  background: #fff;
280
  border: 1px solid #e5e7eb;
281
  border-radius: 12px;
282
+ padding: 1.25rem;
283
+ margin-bottom: 1.5rem;
284
  }
285
  .config-card .card-subtitle {
286
+ font-size: 0.78rem;
287
  color: #6b7280;
288
  margin-bottom: 1.25rem;
289
  }
 
307
  }
308
  .config-value .val {
309
  flex: 1;
310
+ padding: 7px 10px;
311
  background: #f9fafb;
312
  border: 1px solid #e5e7eb;
313
  border-radius: 8px;
314
+ font-family: 'SF Mono', 'Consolas', monospace;
315
+ font-size: 0.78rem;
316
  color: #111827;
317
  white-space: nowrap;
318
  overflow: hidden;
 
419
  background: #fff;
420
  border: 1px solid #e5e7eb;
421
  border-radius: 12px;
422
+ padding: 1.25rem;
423
+ margin-bottom: 1.5rem;
424
  }
425
  .tabs {
426
  display: flex;
 
429
  margin-bottom: 1rem;
430
  }
431
  .tab {
432
+ padding: 6px 14px;
433
  background: none;
434
  border: none;
435
  border-bottom: 2px solid transparent;
436
  color: #6b7280;
437
+ font-size: 0.8rem;
438
  font-family: inherit;
439
  cursor: pointer;
440
  transition: all 0.2s;
 
448
  .code-block {
449
  background: #1e1e1e;
450
  border-radius: 10px;
451
+ padding: 1rem 1.25rem;
452
+ font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
453
+ font-size: 0.75rem;
454
+ line-height: 1.5;
455
  color: #d4d4d4;
456
  overflow-x: auto;
457
  white-space: pre;
 
585
  <button class="tab active" onclick="switchTab('python', this)">Python</button>
586
  <button class="tab" onclick="switchTab('curl', this)">cURL</button>
587
  <button class="tab" onclick="switchTab('node', this)">Node.js</button>
588
+ <button class="tab" onclick="switchTab('anthropic', this)">Anthropic</button>
589
+ <button class="tab" onclick="switchTab('gemini', this)">Gemini</button>
590
  </div>
591
  <div class="tab-content active" id="tab-python">
592
  <div class="code-block" id="code-python">Loading...
593
+ <button class="copy-code-btn" onclick="copyCode('code-python')">&#9112; Copy</button></div>
594
  </div>
595
  <div class="tab-content" id="tab-curl">
596
  <div class="code-block" id="code-curl">Loading...
597
+ <button class="copy-code-btn" onclick="copyCode('code-curl')">&#9112; Copy</button></div>
598
  </div>
599
  <div class="tab-content" id="tab-node">
600
  <div class="code-block" id="code-node">Loading...
601
+ <button class="copy-code-btn" onclick="copyCode('code-node')">&#9112; Copy</button></div>
602
+ </div>
603
+ <div class="tab-content" id="tab-anthropic">
604
+ <div class="code-block" id="code-anthropic">Loading...
605
+ <button class="copy-code-btn" onclick="copyCode('code-anthropic')">&#9112; Copy</button></div>
606
+ </div>
607
+ <div class="tab-content" id="tab-gemini">
608
+ <div class="code-block" id="code-gemini">Loading...
609
+ <button class="copy-code-btn" onclick="copyCode('code-gemini')">&#9112; Copy</button></div>
610
  </div>
611
  </div>
612
  </div>
 
866
  for await (const chunk of stream) {
867
  process.stdout.write(chunk.choices[0]?.delta?.content || "");
868
  }
869
+ <button class="copy-code-btn" onclick="copyCode('code-node')">&#9112; Copy</button>`;
870
+
871
+ const messagesUrl = escapeHtml(window.location.origin + '/v1/messages');
872
+ document.getElementById('code-anthropic').innerHTML =
873
+ `import Anthropic from "@anthropic-ai/sdk";
874
+
875
+ const client = new Anthropic({
876
+ baseURL: "${messagesUrl.replace('/v1/messages', '/v1')}",
877
+ apiKey: "${apiKey}",
878
+ });
879
+
880
+ const message = await client.messages.create({
881
+ model: "claude-sonnet-4-20250514",
882
+ max_tokens: 1024,
883
+ messages: [
884
+ { role: "user", content: "Explain quantum computing in simple terms" },
885
+ ],
886
+ });
887
+
888
+ console.log(message.content[0].text);
889
+ <button class="copy-code-btn" onclick="copyCode('code-anthropic')">&#9112; Copy</button>`;
890
+
891
+ const geminiBase = escapeHtml(window.location.origin);
892
+ document.getElementById('code-gemini').innerHTML =
893
+ `curl ${geminiBase}/v1beta/models/gemini-2.5-pro:generateContent?key=${apiKey} \\
894
+ -H "Content-Type: application/json" \\
895
+ -d '{
896
+ "contents": [
897
+ {"role": "user", "parts": [{"text": "Explain quantum computing"}]}
898
+ ]
899
+ }'
900
+
901
+ # Streaming
902
+ curl ${geminiBase}/v1beta/models/gemini-2.5-pro:streamGenerateContent?alt=sse&key=${apiKey} \\
903
+ -H "Content-Type: application/json" \\
904
+ -d '{
905
+ "contents": [
906
+ {"role": "user", "parts": [{"text": "Explain quantum computing"}]}
907
+ ]
908
+ }'
909
+ <button class="copy-code-btn" onclick="copyCode('code-gemini')">&#9112; Copy</button>`;
910
  }
911
 
912
  function saveOverrides() {