-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput.html
More file actions
431 lines (391 loc) · 16.1 KB
/
Copy pathoutput.html
File metadata and controls
431 lines (391 loc) · 16.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your me.md — Harness Toolkit</title>
<link rel="stylesheet" href="shared.css">
<style>
.me-textarea {
width: 100%;
box-sizing: border-box;
min-height: 380px;
padding: 20px 24px;
font-family: 'Inter', monospace;
font-size: 13px;
line-height: 1.85;
color: var(--ink);
background: var(--cream-deep);
border: 1px solid var(--rule);
border-radius: 0;
resize: vertical;
outline: none;
transition: border-color .15s;
}
.me-textarea:focus { border-color: var(--taupe); }
.action-row {
display: flex;
gap: 12px;
flex-wrap: wrap;
margin-top: 16px;
}
.accordion { margin-top: 8px; }
.accordion-item { border-top: 1px solid var(--rule); }
.accordion-item:last-child { border-bottom: 1px solid var(--rule); }
.accordion-trigger {
width: 100%;
background: none;
border: none;
padding: 18px 0;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
font-family: 'Cormorant Garamond', serif;
font-size: 19px;
font-weight: 500;
color: var(--ink);
text-align: left;
}
.accordion-trigger:hover { color: var(--taupe-deep); }
.accordion-arrow {
font-size: 14px;
color: var(--taupe);
transition: transform .2s;
flex-shrink: 0;
}
.accordion-trigger[aria-expanded="true"] .accordion-arrow { transform: rotate(180deg); }
.accordion-body {
padding-bottom: 20px;
display: none;
}
.accordion-body.open { display: block; }
.accordion-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.acc-step {
display: flex;
gap: 14px;
align-items: flex-start;
font-size: 14px;
line-height: 1.6;
color: var(--ink-soft);
}
.acc-step-num {
font-family: 'Cormorant Garamond', serif;
font-size: 18px;
font-weight: 500;
color: var(--taupe);
min-width: 18px;
line-height: 1.2;
}
.nav-path-sm {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--ink-muted);
background: var(--cream-deep);
padding: 4px 10px;
margin: 6px 0;
flex-wrap: wrap;
}
.nav-step-sm { font-weight: 500; color: var(--ink-soft); }
.nav-arr-sm { color: var(--taupe); }
</style>
</head>
<body>
<div class="page-wrap" id="app"></div>
<script src="tracking.js"></script>
<script src="config.js"></script>
<script src="leads.js"></script>
<script>
const STORAGE_KEY = 'me-md-builder';
const state = (() => {
try { return JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}'); } catch { return {}; }
})();
if (!state.fullName) { window.location.href = 'index.html'; }
// ── Generate me.md (local fallback if AI draft not present) ───
const STYLE_MAP = {
'Very concise': 'Always be very concise. Lead with the answer in one sentence. Expand only if asked.',
'Direct & clear':'Be direct and clear. Lead with the answer, not the explanation. Use bullet points for anything over three items.',
'Detailed': 'Provide detailed responses. Explain your reasoning and cover edge cases.',
'Comprehensive': 'Be comprehensive. Cover all angles, include context, and provide thorough explanations.',
};
function generateMeMd() {
const { fullName, roleAndCompany, location, dayToDay, communicationStyle, customCommunication, currentFocus, people, boundaries, customBoundaries } = state;
const lines = [];
const today = new Date().toLocaleDateString('en-GB', { day: 'numeric', month: 'long', year: 'numeric' });
lines.push(`# ${fullName || 'Your Name'} — Personal Context`, '');
// Who I am
lines.push('## Who I am', '');
if (roleAndCompany) lines.push(roleAndCompany + (location ? `. Based in ${location}.` : '.'));
else if (location) lines.push(`Based in ${location}.`);
if (dayToDay && dayToDay.trim()) lines.push('', dayToDay.trim());
lines.push('');
// How I work
lines.push('## How I work', '');
const style = customCommunication || communicationStyle;
const styleDesc = STYLE_MAP[style] || style;
if (styleDesc) lines.push(styleDesc);
const allBoundaries = [...(boundaries || []), ...(customBoundaries || [])];
if (allBoundaries.length) {
lines.push('');
lines.push('Never:');
allBoundaries.forEach(b => lines.push(`- ${b}`));
}
lines.push('');
// What I'm working on
lines.push('## What I\'m working on', '');
if (currentFocus && currentFocus.trim()) {
const focusLines = currentFocus.trim().split('\n').filter(l => l.trim());
if (focusLines.length > 1) {
focusLines.forEach(l => lines.push(`- ${l.trim()}`));
} else {
lines.push(currentFocus.trim());
}
} else {
lines.push('(Add your current projects here)');
}
lines.push('');
// People in my orbit
lines.push('## People in my orbit', '');
if (people && people.length) {
people.forEach(p => lines.push(`- ${p}`));
} else {
lines.push('(Add key contacts here — name and one line of context each)');
}
lines.push('');
// Standing requests
lines.push('## Standing requests', '');
lines.push('(Add things you want your AI to always do — e.g. "Always summarise at the end", "Always flag legal risk")');
lines.push('');
lines.push('---');
lines.push(`*Generated ${today} via me.md builder. Update this file monthly as your context changes.*`);
return lines.join('\n');
}
// Use AI-generated draft if present (set by form.html on submit); else local generator
const generatedMd = (state.generatedMd && state.generatedMd.length > 100)
? state.generatedMd
: generateMeMd();
// ── Render page ────────────────────────────────────────
const metaParts = [state.roleAndCompany, state.location].filter(Boolean);
document.getElementById('app').innerHTML = `
<div class="masthead">
<div class="masthead-brand">Harness Toolkit</div>
<div class="masthead-meta">A working document</div>
</div>
<div>
<div class="eyebrow">Your personal context file</div>
<h1 class="hero-title">Your me.md — <em>ready</em>.</h1>
<p class="hero-sub">Edit the file below, then copy or download it. Paste it into Claude, ChatGPT, or Gemini — and your AI will respond as if it has already read your brief.</p>
</div>
<div class="profile-card">
<div class="profile-card-head">
<div class="profile-card-title">Prepared for</div>
</div>
<div class="profile-card-body">
<div class="profile-name">${escHtml(state.fullName || '')}</div>
${metaParts.length ? `<div class="profile-line">${escHtml(metaParts.join(' · '))}</div>` : ''}
${state.email ? `<div class="profile-line profile-muted">${escHtml(state.email)}</div>` : ''}
</div>
</div>
<div class="output-step">
<div class="output-step-header">
<div class="step-num">01</div>
<div class="step-info">
<div class="step-title">Your me.md file</div>
<div class="step-desc">Edit anything below — the file is yours. Then copy or download it.</div>
</div>
<div class="step-badge badge-required">Required</div>
</div>
<div class="output-step-body">
<textarea class="me-textarea" id="me-textarea" spellcheck="false">${escAttr(generatedMd)}</textarea>
<div class="action-row">
<button class="copy-btn" id="copy-btn" onclick="copyMd()">
<span class="icon">⎘</span> Copy to clipboard
</button>
<button class="copy-btn" id="dl-btn" onclick="downloadMd()">
⬇ Download me.md
</button>
</div>
</div>
</div>
<div class="output-step">
<div class="output-step-header">
<div class="step-num">02</div>
<div class="step-info">
<div class="step-title">Paste into your AI tool</div>
<div class="step-desc">Choose your tool below for step-by-step instructions.</div>
</div>
<div class="step-badge badge-optional">Optional</div>
</div>
<div class="output-step-body">
<div class="accordion" id="llm-accordion">
<div class="accordion-item">
<button class="accordion-trigger" aria-expanded="false" onclick="toggleAccordion(this)">
Claude
<span class="accordion-arrow">▾</span>
</button>
<div class="accordion-body">
<div class="accordion-steps">
<div class="acc-step">
<div class="acc-step-num">01</div>
<div><strong>Claude.ai (web or app)</strong> — Open Settings → Personalisation → Custom instructions. Paste your me.md there. Claude reads it at the start of every conversation.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">02</div>
<div><strong>Claude Projects</strong> — Open any Project → Project instructions. Paste your me.md. It stays active for every conversation within that project.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">03</div>
<div><strong>Or just paste it</strong> — Drop the me.md content at the top of any new conversation: <em>"Here is my context — please read this before we start."</em></div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<button class="accordion-trigger" aria-expanded="false" onclick="toggleAccordion(this)">
ChatGPT
<span class="accordion-arrow">▾</span>
</button>
<div class="accordion-body">
<div class="accordion-steps">
<div class="acc-step">
<div class="acc-step-num">01</div>
<div>Click your profile icon (top-right) → <strong>Settings</strong> → <strong>Personalization</strong> → <strong>Custom instructions</strong>.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">02</div>
<div>In the first box ("What would you like ChatGPT to know about you?"), paste your me.md. Save.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">03</div>
<div>ChatGPT will include this context in every new conversation. You can update it any time from the same settings panel.</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<button class="accordion-trigger" aria-expanded="false" onclick="toggleAccordion(this)">
Gemini
<span class="accordion-arrow">▾</span>
</button>
<div class="accordion-body">
<div class="accordion-steps">
<div class="acc-step">
<div class="acc-step-num">01</div>
<div>Go to <strong>gemini.google.com</strong> → <strong>Explore Gems</strong> (left sidebar) → <strong>New gem</strong>.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">02</div>
<div>In the Instructions field, paste your me.md. Name the gem "Me" or your name. Save.</div>
</div>
<div class="acc-step">
<div class="acc-step-num">03</div>
<div>Open your gem whenever you start a work session — it will use your context automatically. You can also paste directly at the top of any standard conversation.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="share-row" style="margin-top:24px;">
<button class="share-btn share-btn-primary" id="btn-share-li" onclick="shareOnLinkedIn()">Share on LinkedIn</button>
<button class="share-btn" id="btn-copy-link" onclick="copyShareLink()">Copy shareable link</button>
</div>
<div class="footer-links">
<span>© Harness Toolkit · Prepared 2026</span>
<span>
<a onclick="editAnswers()">Edit my answers</a>
<a onclick="startOver()">Start over</a>
</span>
</div>
`;
// ── Interactions ───────────────────────────────────────
function getMdText() {
return (document.getElementById('me-textarea') || {}).value || generatedMd;
}
function copyMd() {
const text = getMdText();
const btn = document.getElementById('copy-btn');
const original = btn.innerHTML;
const doSuccess = () => {
btn.classList.add('copied');
btn.innerHTML = '<span class="icon">✓</span> Copied';
setTimeout(() => { btn.classList.remove('copied'); btn.innerHTML = original; }, 2000);
};
const doFail = () => { btn.textContent = 'Copy failed'; setTimeout(() => { btn.innerHTML = original; }, 2000); };
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(text).then(doSuccess).catch(doFail);
} else {
const ta = document.createElement('textarea');
ta.value = text;
ta.style.cssText = 'position:fixed;opacity:0';
document.body.appendChild(ta);
try { ta.select(); document.execCommand('copy') ? doSuccess() : doFail(); }
catch { doFail(); }
finally { ta.remove(); }
}
}
function downloadMd() {
const text = getMdText();
const blob = new Blob([text], { type: 'text/markdown' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'me.md';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function toggleAccordion(trigger) {
const isOpen = trigger.getAttribute('aria-expanded') === 'true';
trigger.setAttribute('aria-expanded', String(!isOpen));
const body = trigger.nextElementSibling;
body.classList.toggle('open', !isOpen);
}
function editAnswers() {
window.location.href = 'form.html';
}
function startOver() {
try { localStorage.removeItem(STORAGE_KEY); } catch { /* ok */ }
window.location.href = 'index.html';
}
function escHtml(str) {
return String(str || '').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\n/g,'<br>');
}
function escAttr(str) {
return String(str || '').replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');
}
function shareOnLinkedIn() {
const shareUrl = `${TOOLKIT_PUBLIC_URL}?utm_source=share_card&utm_medium=linkedin`;
window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(shareUrl)}`, '_blank', 'noopener,noreferrer');
}
async function copyShareLink() {
const shareUrl = `${TOOLKIT_PUBLIC_URL}?utm_source=share_card&utm_medium=copy`;
const btn = document.getElementById('btn-copy-link');
const original = btn.textContent;
try {
if (navigator.clipboard && window.isSecureContext) {
await navigator.clipboard.writeText(shareUrl);
} else {
const ta = document.createElement('textarea');
ta.value = shareUrl;
ta.style.cssText = 'position:fixed;opacity:0';
document.body.appendChild(ta);
try { ta.select(); const ok = document.execCommand('copy'); if (!ok) throw new Error(); }
finally { ta.remove(); }
}
btn.textContent = '✓ Copied';
btn.classList.add('copied');
setTimeout(() => { btn.textContent = original; btn.classList.remove('copied'); }, 2000);
} catch {
btn.textContent = 'Copy failed';
setTimeout(() => { btn.textContent = original; }, 2000);
}
}
// Lead was already submitted on form submit — no re-submit needed here.
</script>
</body>
</html>