3 left
3 free runs left
U
Emails Written
0
Generate your first batch →
Runs Used
0/3
3 free runs remaining
Leads Tracked
0
Auto-saved when you generate
Time Saved
~11 min saved per run
Prospect Details
📧 Cold Email
💼 LinkedIn DM
// ─── Dark Mode ──────────────────────────────────────────────── function toggleDark() { const on = document.body.classList.toggle("dark"); const btn = document.getElementById("dark-toggle"); if (btn) btn.className = "dark-toggle" + (on ? " on" : ""); state.darkMode = on; saveState(); } function applyDark() { if (state.darkMode) { document.body.classList.add("dark"); const btn = document.getElementById("dark-toggle"); if (btn) btn.className = "dark-toggle on"; } } // ─── Onboarding ─────────────────────────────────────────────── let obStep = 1; function showOnboarding() { if (state.onboardingDone) return; document.getElementById("onboarding-modal").style.display = ""; obStep = 1; updateOnboardingUI(); } function updateOnboardingUI() { const steps = [ { num:"Step 1 of 3", title:"What do you sell?", sub:"Tell us about your product or service. This pre-fills every outreach so you never type it again.", pct:"33%" }, { num:"Step 2 of 3", title:"Who's your ideal customer?", sub:"This helps the AI personalise your outreach with the right language and pain points.", pct:"66%" }, { num:"Step 3 of 3", title:"You're ready to go 🎉", sub:"3 free emails waiting. No credit card needed.", pct:"100%" }, ]; const s = steps[obStep - 1]; document.getElementById("onboarding-step-num").textContent = s.num; document.getElementById("onboarding-title").textContent = s.title; document.getElementById("onboarding-sub").textContent = s.sub; document.getElementById("onboarding-bar").style.width = s.pct; document.getElementById("onboarding-field-1").style.display = obStep === 1 ? "" : "none"; document.getElementById("onboarding-field-2").style.display = obStep === 2 ? "" : "none"; document.getElementById("onboarding-field-3").style.display = obStep === 3 ? "" : "none"; document.getElementById("onboarding-next-btn").textContent = obStep === 3 ? "Start Writing →" : "Next →"; ["ob-dot-0","ob-dot-1","ob-dot-2"].forEach((id, i) => { document.getElementById(id).className = "onboarding-dot" + (i < obStep ? " active" : ""); }); } function onboardingNext() { if (obStep === 1) { const val = document.getElementById("ob-product").value.trim(); if (val) { document.getElementById("f-product").value = val; state.savedProduct = val; } obStep = 2; updateOnboardingUI(); } else if (obStep === 2) { const val = document.getElementById("ob-target").value.trim(); if (val) state.savedTarget = val; obStep = 3; updateOnboardingUI(); } else { document.getElementById("onboarding-modal").style.display = "none"; state.onboardingDone = true; saveState(); showToast("Welcome to PitchOS! Generate your first outreach below. ✦"); } } // ─── Email capture ──────────────────────────────────────────── function openPaywall() { // Show email capture first if no email saved if (!state.capturedEmail) { document.getElementById("capture-modal").style.display = ""; } else { document.getElementById("paywall").style.display = ""; } } function submitCapture() { const email = document.getElementById("capture-email").value.trim(); if (!email || !email.includes("@")) { showToast("Please enter a valid email."); return; } state.capturedEmail = email; saveState(); document.getElementById("capture-modal").style.display = "none"; document.getElementById("paywall").style.display = ""; showToast("✓ Discount applied — check your email shortly!"); // In production: POST email to your backend/Mailchimp/ConvertKit console.log("Captured email:", email); } function skipCapture() { document.getElementById("capture-modal").style.display = "none"; document.getElementById("paywall").style.display = ""; } // ─── Export CSV ─────────────────────────────────────────────── function exportCSV() { if (state.leads.length === 0) { showToast("No leads to export yet."); return; } const headers = ["Name","Title","Company","Status","Score","Emails","Channel"]; const rows = state.leads.map(l => [l.name, l.title, l.company, l.status, l.score, l.emails, l.channel].map(v => `"${v}"`).join(",")); const csv = [headers.join(","), ...rows].join("\n"); const blob = new Blob([csv], { type: "text/csv" }); const a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = "pitchos-leads-" + new Date().toISOString().split("T")[0] + ".csv"; a.click(); showToast("✓ CSV downloaded — " + state.leads.length + " leads"); } // ─── Export PDF (simple print) ──────────────────────────────── function exportPDF() { if (state.leads.length === 0) { showToast("No leads to export yet."); return; } const rows = state.leads.map(l => `${l.name}${l.title}${l.company}${l.status}${l.score}${l.channel}`).join(""); const win = window.open("", "_blank"); win.document.write(`PitchOS Leads

PitchOS — Lead Export

Exported ${new Date().toLocaleDateString()} · ${state.leads.length} leads

${rows}
NameTitleCompanyStatusScoreChannel
`); win.document.close(); win.print(); } // ─── Reply handler tool ─────────────────────────────────────── // (Added to runTool switch below via patch) // ─── Referral ───────────────────────────────────────────────── function copyReferral() { const link = document.getElementById("referral-link").value; navigator.clipboard.writeText(link).then(() => showToast("✓ Referral link copied!")); } function shareReferral() { const link = document.getElementById("referral-link").value; if (navigator.share) { navigator.share({ title: "PitchOS — AI Sales Outreach", text: "I've been using PitchOS to write cold emails — it's 🔥. Try it free:", url: link }); } else { copyReferral(); } } function shareVia(platform) { const link = encodeURIComponent("https://pitchos.pro?ref=USER123"); const text = encodeURIComponent("I've been using PitchOS to 3x my cold email replies — try it free:"); const urls = { linkedin: `https://www.linkedin.com/sharing/share-offsite/?url=${link}`, twitter: `https://twitter.com/intent/tweet?text=${text}&url=${link}`, email: `mailto:?subject=You%20should%20try%20PitchOS&body=${text}%20${link}`, whatsapp: `https://wa.me/?text=${text}%20${link}`, }; window.open(urls[platform], "_blank"); } // ─── Update leads export count ──────────────────────────────── const _origRenderLeads = renderLeads;