File size: 9,059 Bytes
5a72b92
 
 
 
 
 
 
ec0706f
5a72b92
 
 
 
 
ec0706f
 
e8fb2cf
5a72b92
 
 
 
 
 
 
e8fb2cf
 
 
 
ec0706f
e8fb2cf
5a72b92
 
e8fb2cf
5a72b92
e8fb2cf
5a72b92
e8fb2cf
 
 
 
 
 
 
5a72b92
e8fb2cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ec0706f
5a72b92
e8fb2cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a72b92
e8fb2cf
5a72b92
 
e8fb2cf
 
 
 
 
 
 
 
 
 
 
 
 
 
ec0706f
 
 
 
e8fb2cf
ec0706f
 
e8fb2cf
 
 
 
 
 
 
 
 
 
ec0706f
5a72b92
e8fb2cf
 
 
ec0706f
5a72b92
 
e8fb2cf
ec0706f
 
 
 
 
 
 
e8fb2cf
ec0706f
 
 
5a72b92
ec0706f
 
 
 
 
 
 
 
 
e8fb2cf
 
ec0706f
 
 
e8fb2cf
 
 
 
5a72b92
e8fb2cf
ec0706f
e8fb2cf
 
 
 
ec0706f
 
 
 
 
 
 
5a72b92
ec0706f
5a72b92
 
 
ec0706f
 
 
5a72b92
e8fb2cf
5a72b92
ec0706f
 
 
5a72b92
ec0706f
5a72b92
 
e8fb2cf
5a72b92
ec0706f
5a72b92
ec0706f
5a72b92
 
ec0706f
e8fb2cf
5a72b92
e8fb2cf
ec0706f
 
e8fb2cf
ec0706f
 
 
 
 
e8fb2cf
5a72b92
 
e8fb2cf
 
5a72b92
e8fb2cf
5a72b92
e8fb2cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a72b92
 
ec0706f
 
 
5a72b92
 
 
 
 
e8fb2cf
 
 
 
 
5a72b92
e8fb2cf
 
 
 
 
 
ec0706f
e8fb2cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a72b92
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>PROJECT: BOB</title>
  <style>
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html, body {
      height: 100%;
      background: #000000;
      color: #ffffff;
      font-family: monospace, monospace;
      font-size: 14px;
      line-height: 1.6;
      overflow: hidden;
    }
    body {
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }
    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 1.5rem;
      border-bottom: 1px solid #ffffff;
      flex-shrink: 0;
    }
    header h1 {
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: 0.15em;
    }
    #new-chat-btn {
      background: #000000;
      border: 1px solid #ffffff;
      color: #ffffff;
      font-family: inherit;
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      padding: 0.5rem 1rem;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
    }
    #new-chat-btn:hover { background: #ffffff; color: #000000; }
    .app-container {
      display: flex;
      flex: 1;
      overflow: hidden;
    }
    /* Sidebar */
    aside {
      width: 280px;
      flex-shrink: 0;
      border-right: 1px solid #ffffff;
      display: flex;
      flex-direction: column;
      background: #000000;
    }
    .sidebar-header {
      padding: 1rem;
      border-bottom: 1px solid #ffffff;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      opacity: 0.7;
    }
    .chat-list {
      flex: 1;
      overflow-y: auto;
      padding: 0.5rem;
    }
    .chat-item {
      padding: 0.75rem 1rem;
      margin-bottom: 0.5rem;
      border: 1px solid transparent;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-item:hover { border-color: #ffffff; background: #111111; }
    .chat-item.active { border-color: #ffffff; background: #1a1a1a; }
    .chat-item-title {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      margin-bottom: 0.25rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-item-preview {
      font-size: 0.65rem;
      opacity: 0.5;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .chat-item-time {
      font-size: 0.55rem;
      opacity: 0.4;
      margin-top: 0.25rem;
    }
    .empty-chats {
      padding: 2rem 1rem;
      text-align: center;
      opacity: 0.4;
      font-size: 0.75rem;
    }
    /* Main chat area */
    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
      background: #000000;
    }
    .chat-header {
      padding: 1rem 1.5rem;
      border-bottom: 1px solid #ffffff;
      flex-shrink: 0;
    }
    .chat-header-title {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      opacity: 0.7;
    }
    #chat {
      flex: 1;
      overflow-y: auto;
      padding: 1.5rem;
      display: flex;
      flex-direction: column;
      gap: 1.25rem;
    }
    .welcome {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      opacity: 0.5;
      gap: 1rem;
    }
    .welcome h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: 0.1em; }
    .welcome p { font-size: 0.85rem; max-width: 400px; line-height: 1.7; }
    .welcome .hint { font-size: 0.65rem; opacity: 0.4; margin-top: 1rem; letter-spacing: 0.1em; }
    .message {
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
      max-width: 85%;
      animation: fadeIn 0.2s ease;
    }
    @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    .message.user { align-self: flex-end; }
    .message.bot { align-self: flex-start; }
    .message-label {
      font-size: 0.6rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      opacity: 0.5;
    }
    .message.user .message-label { text-align: right; }
    .message-content {
      white-space: pre-wrap;
      word-wrap: break-word;
      padding: 0.75rem 1rem;
      border: 1px solid #ffffff;
      background: #000000;
    }
    .message.tool-result {
      font-size: 0.7rem;
      opacity: 0.6;
      font-family: monospace;
      background: #000000;
      border: 1px dashed #ffffff;
      padding: 0.5rem 0.75rem;
      max-width: 100%;
      align-self: flex-start;
      margin-left: 0;
    }
    /* Input area */
    .input-area {
      padding: 1rem 1.5rem;
      border-top: 1px solid #ffffff;
      flex-shrink: 0;
      background: #000000;
    }
    .input-row {
      display: flex;
      gap: 0.75rem;
    }
    #input {
      flex: 1;
      background: #000000;
      border: 1px solid #ffffff;
      color: #ffffff;
      font-family: inherit;
      font-size: 1rem;
      padding: 0.875rem 1rem;
      min-height: 56px;
      resize: none;
      outline: none;
      line-height: 1.5;
    }
    #input:focus { border-color: #ffffff; box-shadow: 0 0 0 1px #ffffff; }
    #input::placeholder { color: #ffffff60; }
    #execute {
      background: #000000;
      border: 1px solid #ffffff;
      color: #ffffff;
      font-family: inherit;
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      padding: 0.875rem 1.5rem;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      white-space: nowrap;
      align-self: flex-end;
    }
    #execute:hover:not(:disabled), #execute:focus:not(:disabled) { background: #ffffff; color: #000000; outline: none; }
    #execute:disabled { opacity: 0.4; cursor: not-allowed; }
    .status {
      font-size: 0.6rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      opacity: 0.5;
      text-align: center;
      min-height: 1rem;
      margin-top: 0.5rem;
    }
    footer {
      padding: 0.5rem;
      font-size: 0.55rem;
      letter-spacing: 0.1em;
      opacity: 0.3;
      text-align: center;
      border-top: 1px solid #ffffff;
      flex-shrink: 0;
    }
    /* Mobile */
    @media (max-width: 900px) {
      aside { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 2px 0 8px rgba(255,255,255,0.1); }
      aside.open { transform: translateX(0); }
      .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 99; }
      .sidebar-overlay.open { display: block; }
      header { padding: 0.75rem 1rem; }
      main { padding-left: 0; }
      #menu-btn { display: block; background: none; border: 1px solid #ffffff; color: #ffffff; padding: 0.4rem 0.75rem; font-family: inherit; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
      #menu-btn:hover { background: #ffffff; color: #000000; }
      .chat-header { padding: 0.75rem 1rem; }
      .input-area { padding: 0.75rem 1rem; }
    }
    @media (max-width: 600px) {
      .input-row { flex-direction: column; }
      #execute { width: 100%; }
      .message { max-width: 100%; }
    }
  </style>
</head>
<body>
  <header>
    <div style="display:flex; align-items:center; gap:0.75rem;">
      <button id="menu-btn" style="display:none;">MENU</button>
      <h1>PROJECT: BOB</h1>
    </div>
    <button id="new-chat-btn" type="button">NEW CHAT</button>
  </header>
  <div class="sidebar-overlay" id="sidebar-overlay"></div>
  <div class="app-container">
    <aside id="sidebar">
      <div class="sidebar-header">CHATS</div>
      <div class="chat-list" id="chat-list">
        <div class="empty-chats">No chats yet.<br>Click "NEW CHAT" to start.</div>
      </div>
    </aside>
    <main>
      <div class="chat-header">
        <div class="chat-header-title" id="chat-title">Select a chat or start new</div>
      </div>
      <div id="chat">
        <div class="welcome">
          <h2>BOB</h2>
          <p>Local-first AI running 100% in your browser via WebAssembly.<br>No servers. No cloud. No tracking.</p>
          <div class="hint">Ctrl+Enter to send · Try "What's Bitcoin price?" or "Multiply 144 by 37"</div>
        </div>
      </div>
      <div class="input-area">
        <div class="input-row">
          <textarea id="input" placeholder="Type your message... (Ctrl+Enter to send)"></textarea>
          <button id="execute" type="button">SEND</button>
        </div>
        <div class="status" id="status"></div>
      </div>
    </main>
  </div>
  <footer>PROJECT BOB — LOCAL-FIRST AI</footer>
  <script type="module" src="app.js"></script>
</body>
</html>