-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathchat.html
More file actions
330 lines (288 loc) · 8.16 KB
/
Copy pathchat.html
File metadata and controls
330 lines (288 loc) · 8.16 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Deepline GTM Agent</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: #080b12;
color: #e2e8f0;
height: 100dvh;
display: flex;
flex-direction: column;
}
header {
padding: 16px 24px;
border-bottom: 1px solid #1e2535;
display: flex;
align-items: center;
gap: 12px;
background: #0d1117;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
}
.logo-mark {
width: 32px;
height: 32px;
border-radius: 8px;
background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: 700;
color: #fff;
letter-spacing: -0.5px;
flex-shrink: 0;
}
.logo-text {
display: flex;
flex-direction: column;
gap: 1px;
}
.logo-text h1 {
font-size: 14px;
font-weight: 600;
color: #f1f5f9;
letter-spacing: -0.2px;
}
.logo-text span {
font-size: 11px;
color: #475569;
}
.status {
margin-left: auto;
display: flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: #475569;
}
.status-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #22c55e;
box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
#messages {
flex: 1;
overflow-y: auto;
padding: 28px 24px;
display: flex;
flex-direction: column;
gap: 16px;
}
#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: #1e2535; border-radius: 2px; }
.msg {
max-width: 78%;
line-height: 1.6;
font-size: 14px;
}
.msg.user {
align-self: flex-end;
background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
color: #fff;
padding: 10px 16px;
border-radius: 18px 18px 4px 18px;
box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.msg.assistant {
align-self: flex-start;
background: #111827;
border: 1px solid #1e2535;
padding: 14px 18px;
border-radius: 4px 18px 18px 18px;
white-space: pre-wrap;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.msg.assistant p { margin-bottom: 8px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant strong { color: #f1f5f9; }
.msg.assistant code {
background: #0d1117;
border: 1px solid #1e2535;
padding: 2px 6px;
border-radius: 4px;
font-size: 12px;
font-family: "SF Mono", "Fira Code", monospace;
color: #7dd3fc;
}
.thinking {
color: #475569;
font-style: italic;
font-size: 13px;
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
.suggestions {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 0 24px 16px;
}
.chip {
background: #0d1117;
border: 1px solid #1e2535;
border-radius: 22px;
padding: 7px 14px;
font-size: 12px;
color: #94a3b8;
cursor: pointer;
transition: all .15s;
max-width: 340px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.chip:hover {
border-color: #3b82f6;
color: #e2e8f0;
background: #111827;
}
#input-area {
padding: 16px 24px;
border-top: 1px solid #1e2535;
display: flex;
gap: 10px;
background: #0d1117;
}
textarea {
flex: 1;
background: #111827;
border: 1px solid #1e2535;
border-radius: 12px;
color: #e2e8f0;
font-size: 14px;
padding: 10px 16px;
resize: none;
outline: none;
font-family: inherit;
line-height: 1.5;
max-height: 120px;
transition: border-color .15s;
}
textarea::placeholder { color: #334155; }
textarea:focus { border-color: #3b82f6; }
button {
background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
color: white;
border: none;
border-radius: 12px;
padding: 0 20px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: opacity .15s;
min-width: 68px;
}
button:hover { opacity: 0.9; }
button:disabled { background: #1e2535; color: #334155; cursor: not-allowed; opacity: 1; }
</style>
</head>
<body>
<header>
<div class="logo">
<div class="logo-mark">D</div>
<div class="logo-text">
<h1>Deepline GTM Agent</h1>
<span>Powered by code.deepline.com</span>
</div>
</div>
<div class="status">
<div class="status-dot"></div>
<span>Ready</span>
</div>
</header>
<div id="messages">
<div class="msg assistant">Hey — I'm your GTM agent. I can find and enrich prospects, research companies, verify emails, and build account lists. What are you working on?</div>
</div>
<div class="suggestions" id="suggestions">
<div class="chip" onclick="send(this.innerText)">Find 5 VP of Sales at B2B SaaS, 200–500 employees, US — full names, LinkedIn URLs, and verified emails</div>
<div class="chip" onclick="send(this.innerText)">New inbound: Marcus Williams, Director of Sales Ops at HubSpot. Verify his email, research him, draft a personalized opener.</div>
<div class="chip" onclick="send(this.innerText)">Account intel brief on stripe.com — headcount, tech stack, hiring signals, and 2 talking points</div>
<div class="chip" onclick="send(this.innerText)">Find the Head of Engineering at Rippling, Notion, and Linear — LinkedIn URL + verified email for each</div>
<div class="chip" onclick="send(this.innerText)">Verify these emails: jsmith@salesforce.com, alex@notion.so, ceo@bigcorp.com</div>
<div class="chip" onclick="send(this.innerText)">Score monday.com, Asana, and ClickUp on ICP fit (1–10) based on headcount, tech stack, and hiring signals</div>
</div>
<div id="input-area">
<textarea id="input" placeholder="Ask anything GTM..." rows="1" onkeydown="handleKey(event)" oninput="autoResize(this)"></textarea>
<button id="send-btn" onclick="sendInput()">Send</button>
</div>
<script>
const API = '';
const history = [];
function autoResize(el) {
el.style.height = 'auto';
el.style.height = Math.min(el.scrollHeight, 120) + 'px';
}
function handleKey(e) {
if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendInput(); }
}
function send(text) {
document.getElementById('input').value = text;
sendInput();
}
function addMsg(role, text) {
const el = document.createElement('div');
el.className = 'msg ' + role;
if (role === 'assistant') {
el.innerHTML = text
.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
.replace(/`(.+?)`/g, '<code>$1</code>');
} else {
el.textContent = text;
}
document.getElementById('messages').appendChild(el);
el.scrollIntoView({ behavior: 'smooth' });
return el;
}
async function sendInput() {
const inp = document.getElementById('input');
const btn = document.getElementById('send-btn');
const text = inp.value.trim();
if (!text) return;
document.getElementById('suggestions').style.display = 'none';
inp.value = '';
inp.style.height = 'auto';
btn.disabled = true;
addMsg('user', text);
history.push({ role: 'user', content: text });
const thinking = addMsg('assistant', '…');
thinking.className = 'msg assistant thinking';
try {
const res = await fetch(API + '/chat', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ messages: history }),
});
const data = await res.json();
const reply = data.message || data.detail || 'No response';
thinking.className = 'msg assistant';
thinking.innerHTML = reply
.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>')
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
.replace(/`(.+?)`/g, '<code>$1</code>');
history.push({ role: 'assistant', content: reply });
} catch (e) {
thinking.className = 'msg assistant';
thinking.textContent = 'Error: ' + e.message;
}
btn.disabled = false;
inp.focus();
}
</script>
</body>
</html>