forked from Nearcyan/vibecraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
477 lines (426 loc) · 19.7 KB
/
index.html
File metadata and controls
477 lines (426 loc) · 19.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Watch and Manage Claude Code in 3D!" />
<meta name="theme-color" content="#0f172a" />
<title>Vibecraft - Watch and Manage Claude Code in 3D!</title>
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<!-- Open Graph / Social -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Vibecraft" />
<meta property="og:title" content="Vibecraft - Watch and Manage Claude Code in 3D!" />
<meta property="og:description" content="Watch and Manage Claude Code in 3D!" />
<meta property="og:image" content="https://vibecraft.sh/og-image.png" />
<meta property="og:url" content="https://vibecraft.sh" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Vibecraft - Watch and Manage Claude Code in 3D!" />
<meta name="twitter:description" content="Watch and Manage Claude Code in 3D!" />
<meta name="twitter:image" content="https://vibecraft.sh/og-image.png" />
<!-- Analytics -->
<script src="https://cdn.amplitude.com/script/3b78e993d3c7ddad9fb9ae615cc094b6.js"></script>
<script>window.amplitude.init('3b78e993d3c7ddad9fb9ae615cc094b6', {"fetchRemoteConfig":true,"autocapture":{"attribution":true,"fileDownloads":true,"formInteractions":true,"pageViews":true,"sessions":true,"elementInteractions":true,"networkTracking":true,"webVitals":true,"frustrationInteractions":true}});</script>
</head>
<body>
<div id="app">
<!-- Left: 3D Scene -->
<div id="scene-panel">
<div id="canvas-container"></div>
<!-- Scene HUD -->
<div id="scene-hud">
<div class="scene-badge unified-hud">
<div id="status-dot"></div>
<span id="username" class="hud-user">...</span>
<span id="status-text"></span>
<span class="hud-sep">|</span>
<span id="token-counter" class="hud-tokens" title="Tokens used this session">⚡ 0 tok</span>
<span class="hud-sep">|</span>
<button id="settings-btn" class="hud-btn" title="Settings">⚙️</button>
<!-- Debug: FPS counter (uncomment to enable)
<span class="hud-sep">|</span>
<span id="fps" class="hud-fps">-- FPS</span>
-->
</div>
</div>
<!-- Dev Panel (animations test) - hidden by default -->
<div id="dev-panel" class="hidden">
<div class="dev-header">🎬 Animations</div>
<div id="dev-animations"></div>
</div>
<!-- Keybind Helper (bottom-left) -->
<div id="keybind-helper">
<div class="keybind-list">
<span class="keybind"><kbd>1-6</kbd> sessions · <kbd>`</kbd><kbd>0</kbd> all · <kbd>Tab</kbd> focus · <kbd>D</kbd> draw</span>
</div>
</div>
<!-- Voice Control (center bottom) -->
<div id="voice-control" class="voice-control">
<!-- Idle state: mic button with hint -->
<div class="voice-idle">
<button type="button" id="voice-btn" class="voice-trigger" title="Start voice input">🎤</button>
<span class="voice-hint"><kbd>Ctrl</kbd><kbd>M</kbd></span>
</div>
<!-- Recording state: bars + dot -->
<div class="voice-recording">
<div class="voice-bars">
<div class="voice-bar" data-bar="0"></div>
<div class="voice-bar" data-bar="1"></div>
<div class="voice-bar" data-bar="2"></div>
<div class="voice-bar" data-bar="3"></div>
<div class="voice-bar" data-bar="4"></div>
<div class="voice-bar" data-bar="5"></div>
<div class="voice-bar" data-bar="6"></div>
<div class="voice-bar" data-bar="7"></div>
<div class="voice-bar" data-bar="8"></div>
<div class="voice-bar" data-bar="9"></div>
</div>
<div class="voice-status-row">
<div class="voice-record-dot"></div>
<span class="voice-send-hint"><kbd>Enter</kbd> to send</span>
</div>
</div>
</div>
<!-- Draw Mode UI (bottom right of scene) -->
<div id="draw-indicator">
<span class="draw-mode-label">DRAW MODE</span>
<span class="draw-mode-hint"><kbd>D</kbd> exit · <kbd>X</kbd> clear · <kbd>Q</kbd><kbd>E</kbd> brush · <kbd>R</kbd> 3D</span>
</div>
<div id="draw-palette">
<!-- Populated by DrawMode.ts -->
</div>
</div>
<!-- Right: Activity Feed -->
<div id="feed-panel">
<div id="feed-header">
<h2>Vibecraft <span class="muted">(vibecraft.sh)</span></h2>
<div class="feed-header-right">
<span id="attention-badge" class="attention-badge hidden">0</span>
<button id="about-btn" class="feed-about-btn" title="About Vibecraft">?</button>
</div>
</div>
<!-- Session Management -->
<div id="sessions-panel">
<div id="sessions-list">
<div class="session-item all-sessions active" data-session="all">
<div class="session-hotkey">0</div>
<div class="session-icon">📋</div>
<div class="session-info">
<div class="session-name">All Sessions</div>
<div class="session-detail" id="all-sessions-count">No active sessions</div>
</div>
</div>
<div id="managed-sessions"></div>
</div>
</div>
<!-- Terminal output panel (hidden by default) -->
<div id="terminal-panel" class="hidden">
<div id="terminal-output"></div>
</div>
<div id="activity-feed-wrapper">
<div id="activity-feed">
<div id="feed-empty">
<div id="feed-empty-icon">🛠️</div>
<h3>Waiting for activity</h3>
<p>Start using Claude Code to see events here</p>
</div>
</div>
<button id="feed-scroll-bottom">↓ Jump to latest</button>
</div>
<div id="prompt-container">
<div id="voice-transcript">
<div class="transcript-label"><span class="recording-dot"></span> Listening...</div>
<div id="voice-transcript-text"></div>
</div>
<form id="prompt-form">
<div class="input-wrapper">
<textarea id="prompt-input" placeholder="Prompt..." autocomplete="off" rows="1"></textarea>
</div>
<button type="submit" id="prompt-submit"><span class="btn-icon">↗</span> Send</button>
<button type="button" id="prompt-cancel"><span class="btn-icon">◼</span> Stop</button>
</form>
<div id="prompt-options">
<span id="prompt-target"></span>
<span id="prompt-status"></span>
</div>
</div>
</div>
</div>
<!-- New Session Modal -->
<div id="new-session-modal">
<div class="modal-content">
<div class="modal-header">
<h3>New Zone</h3>
</div>
<div class="modal-field">
<label for="session-cwd-input">Directory</label>
<input type="text" id="session-cwd-input" placeholder="e.g. /home/user/my-project" autocomplete="off" />
<div class="field-hint">Default: <code id="modal-default-cwd">~</code></div>
</div>
<div class="modal-field">
<label for="session-name-input">Name</label>
<input type="text" id="session-name-input" placeholder="Auto-filled from directory..." autocomplete="off" />
</div>
<div class="modal-field">
<label>Options</label>
<div class="modal-checkboxes">
<label class="modal-checkbox">
<input type="checkbox" id="session-opt-continue" />
<span class="checkbox-label">Continue <code>-c</code></span>
</label>
<label class="modal-checkbox">
<input type="checkbox" id="session-opt-skip-perms" checked />
<span class="checkbox-label">Skip permissions <code>--dangerously-skip-permissions</code></span>
</label>
<label class="modal-checkbox">
<input type="checkbox" id="session-opt-chrome" />
<span class="checkbox-label">Chrome <code>--chrome</code></span>
</label>
</div>
</div>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="modal-cancel">✕ Cancel</button>
<button type="button" class="modal-btn modal-btn-create" id="modal-create">+ Create</button>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settings-modal">
<div class="modal-content">
<div class="modal-header">
<h3>Settings</h3>
</div>
<div class="modal-field">
<label>Audio</label>
<div class="settings-slider-row">
<span class="slider-label">Volume</span>
<input type="range" id="settings-volume" class="settings-slider" min="0" max="100" value="70" />
<span id="settings-volume-value" class="slider-value">70%</span>
</div>
<div class="settings-checkbox-row">
<label class="checkbox-label">
<input type="checkbox" id="settings-spatial-audio" checked />
<span>Spatial Audio</span>
</label>
<span class="field-hint-inline">Volume/pan based on zone position</span>
</div>
</div>
<div class="modal-field">
<label>Privacy</label>
<div class="settings-checkbox-row">
<label class="checkbox-label">
<input type="checkbox" id="settings-streaming-mode" />
<span>Streaming Mode</span>
</label>
<span class="field-hint-inline">Hide username for privacy</span>
</div>
</div>
<div class="modal-field">
<label>World</label>
<div class="settings-slider-row">
<span class="slider-label">Grid Size</span>
<input type="range" id="settings-grid-size" class="settings-slider" min="5" max="80" value="20" />
<span id="settings-grid-size-value" class="slider-value">20</span>
</div>
<div class="field-hint">Number of hex rings from center. Larger = more space, may impact performance.</div>
</div>
<div class="modal-field">
<label>Agent Connection</label>
<div class="settings-port-row">
<span class="port-label">localhost:</span>
<input type="number" id="settings-port" value="4003" min="1" max="65535" />
<span id="settings-port-status" class="port-status"></span>
</div>
<div class="field-hint">Port where the Vibecraft agent is running. Changes require refresh.</div>
</div>
<div class="modal-field">
<label>Sessions</label>
<div class="settings-actions">
<button type="button" class="settings-action-btn" id="settings-refresh-sessions">🔄 Refresh Sessions</button>
</div>
</div>
<div class="modal-field">
<label>Keyboard Shortcuts</label>
<div id="keybind-settings" class="keybind-settings">
<!-- Dynamically populated by KeybindSettings.ts -->
</div>
<div class="field-hint">Click a keybind to change it. Press the new key combination, or Escape to cancel.</div>
</div>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="settings-close">✕ Close</button>
</div>
</div>
</div>
<!-- About Modal -->
<div id="about-modal">
<div class="modal-content about-modal-content">
<div class="modal-header">
<h3>Vibecraft</h3>
</div>
<div class="about-description">
<p>Vibecraft is a A 3D visualization app for Claude Code.</p>
<p>Watch and manage your claudes in real-time - now featuring hexagonal grids!</p>
<p class="about-subtitle">Vibecraft syncs with claude code instances running on your own machine. No files or
code are sent to the web server.</p>
</div>
<div class="about-section">
<div class="about-section-title">Commands</div>
<div class="about-commands">
<div class="about-cmd"><code>npx vibecraft</code><span>Start server</span></div>
<div class="about-cmd"><code>npx vibecraft doctor</code><span>Diagnose issues</span></div>
<div class="about-cmd"><code>npx vibecraft setup</code><span>Reinstall hooks</span></div>
<div class="about-cmd"><code>npx vibecraft uninstall</code><span>Remove hooks</span></div>
</div>
</div>
<div class="about-section">
<div class="about-section-title">Troubleshooting</div>
<p class="about-help-text">If a zone gets stuck, Claude Code may be waiting for input or in an unknown state. Attach to the tmux session to see what's happening:</p>
<div class="about-commands">
<div class="about-cmd"><code>tmux ls</code><span>List sessions</span></div>
<div class="about-cmd"><code>tmux attach -t <em>session</em></code><span>Attach to session</span></div>
</div>
</div>
<div class="about-section">
<div class="about-section-title">Voice Input</div>
<p class="about-help-text">To enable voice input, add your Deepgram API key to <code>.env</code>:</p>
<div class="about-commands">
<div class="about-cmd"><code>DEEPGRAM_API_KEY=your_key_here</code></div>
</div>
</div>
<div class="about-footer">
<span id="about-version" class="about-version">v0.0.0</span>
<span class="about-sep">·</span>
<span class="about-credit">Elysian Labs</span>
</div>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="about-close">Close</button>
</div>
</div>
</div>
<!-- Question Modal (for AskUserQuestion) -->
<div id="question-modal">
<div class="modal-content question-modal-content">
<div class="modal-header">
<span class="question-badge" id="question-badge">Question</span>
<h3 id="question-header">Claude needs input</h3>
</div>
<div class="question-text" id="question-text"></div>
<div class="question-options" id="question-options">
<!-- Options will be inserted here -->
</div>
<div class="question-other">
<label for="question-other-input">Or type your own response:</label>
<textarea id="question-other-input" placeholder="Type here..." rows="2"></textarea>
</div>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="question-skip">Skip</button>
<button type="button" class="modal-btn modal-btn-create" id="question-send-other">Send</button>
</div>
</div>
</div>
<!-- Permission Modal (for tool permissions) -->
<div id="permission-modal">
<div class="modal-content permission-modal-content">
<div class="modal-header">
<span class="permission-badge">Permission Required</span>
<h3>Allow <span class="permission-tool" id="permission-tool">Tool</span>?</h3>
</div>
<div class="permission-context" id="permission-context">
<!-- Context will be inserted here -->
</div>
<div class="permission-buttons" id="permission-buttons">
<!-- Buttons will be generated dynamically based on options -->
</div>
</div>
</div>
<!-- Zone Info Modal (for session details) -->
<div id="zone-info-modal">
<div class="modal-content zone-info-modal-content">
<div class="modal-header">
<h3>Zone Info</h3>
<button type="button" class="zone-info-close-btn" id="zone-info-close">×</button>
</div>
<div class="zone-info-body" id="zone-info-content">
<!-- Content will be inserted dynamically -->
</div>
</div>
</div>
<!-- Text Label Modal (for hex text labels) -->
<div id="text-label-modal">
<div class="modal-content text-label-modal-content">
<div class="modal-header">
<h3 id="text-label-title">Add Label</h3>
</div>
<div class="text-label-body">
<textarea
id="text-label-input"
class="text-label-textarea"
placeholder="Enter your text here..."
maxlength="500"
rows="4"
></textarea>
<div class="text-label-footer">
<span class="text-label-char-count" id="text-label-char-count">0/500</span>
<span class="text-label-hint">Enter to save, Shift+Enter for newline</span>
</div>
</div>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="text-label-cancel">Cancel</button>
<button type="button" class="modal-btn modal-btn-create" id="text-label-save">Save</button>
</div>
</div>
</div>
<!-- Zone Timeout Modal (shown when zone creation takes too long) -->
<div id="zone-timeout-modal">
<div class="modal-content zone-timeout-content">
<div class="modal-header">
<h3>Zone Not Responding</h3>
</div>
<p class="zone-timeout-text">
The zone is taking longer than expected to start. Claude Code may be stuck or waiting for input.
</p>
<div class="about-section">
<div class="about-section-title">Troubleshooting</div>
<div class="about-commands">
<div class="about-cmd"><code>tmux ls</code><span>List sessions</span></div>
<div class="about-cmd"><code>tmux attach -t <em>session</em></code><span>See what's happening</span></div>
</div>
</div>
<p class="zone-timeout-hint">Also ensure your Claude Code is up to date.</p>
<div class="modal-actions">
<button type="button" class="modal-btn modal-btn-cancel" id="zone-timeout-close">Close</button>
</div>
</div>
</div>
<!-- Offline Banner (shown when user tries to interact while disconnected) -->
<div id="offline-banner" class="offline-banner hidden">
<span>Not connected to local server</span>
<button id="offline-banner-dismiss">×</button>
</div>
<!-- Not Connected Overlay -->
<div id="not-connected-overlay">
<div class="not-connected-content">
<h2>Vibecraft!</h2>
<p class="not-connected-description">
Vibecraft is a 3D app to watch and manage Claude Code instances.
</p>
<p class="not-connected-privacy">
Vibecraft syncs with CC instances running on your local machine. Vibecraft is an interface - no files or code
are sent to this server.
</p>
<div class="not-connected-setup">
<p class="not-connected-setup-label">Get started:</p>
<div class="not-connected-code">npx vibecraft setup && npx vibecraft</div>
</div>
<div class="not-connected-actions">
<button class="not-connected-btn not-connected-btn-retry" id="retry-connection">↻ Reconnect</button>
<button class="not-connected-btn not-connected-btn-explore" id="explore-offline">👀 Explore</button>
</div>
</div>
</div>
<!-- Toast notifications -->
<div id="toast-container"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>