MARCELLIS.LINKHomeGereedschappenFamilieDocumentatieOpenstaandHerbouwplan

Rewrite Pro

AI detection + human rewrite. Five modes: KDP, Blog, Email, YouTube, Social.

Books, ebooks, Kindle Direct Publishing — literary human voice
not stored · local only
0 characters
Drop your file here
or click to browse  ·  .pdf  ·  .md  ·  .txt  ·  .odt  ·  .epub
Analyzing chunks... 0 / 0
Preparing...
Reading the signals...
// auto-clean loop
—
Starting...
✓ cleaned text — risk: 0

keep in mind
`; const iframe = document.createElement('iframe'); iframe.style.cssText = 'position:fixed;top:-9999px;left:-9999px;width:210mm;height:297mm'; document.body.appendChild(iframe); iframe.contentDocument.open(); iframe.contentDocument.write(html); iframe.contentDocument.close(); setTimeout(() => { iframe.contentWindow.focus(); iframe.contentWindow.print(); setTimeout(() => document.body.removeChild(iframe), 2000); }, 600); return; } // .md download const a = document.createElement('a'); a.href = URL.createObjectURL(new Blob([txt], { type: 'text/markdown' })); a.download = base + '.md'; a.click(); URL.revokeObjectURL(a.href); } // ── FULL REWRITE — bypasses analysis, rewrites entire text ── async function fullRewrite() { const keyVal = document.getElementById('apiKeyInput') ? document.getElementById('apiKeyInput').value.trim() : ''; if (!keyVal) { document.getElementById('errorBox').textContent = 'Toevoegen your API key first.'; document.getElementById('errorBox').classList.add('visible'); return; } const activeTab = document.getElementById('tab-file').classList.contains('active'); const text = activeTab ? (loadedFileText || '').trim() : document.getElementById('inputText').value.trim(); if (!text) { showError('No text to rewrite.'); return; } const btn = document.getElementById('fullRewriteBtn'); const errorBox = document.getElementById('errorBox'); errorBox.classList.remove('visible'); btn.disabled = true; btn.textContent = 'Rewriting...'; const cleanLoopWrap = document.getElementById('cleanLoopWrap'); const loopScorePill = document.getElementById('loopScorePill'); const loopStatus = document.getElementById('loopStatus'); const loopFill = document.getElementById('loopProgressFill'); cleanLoopWrap.classList.add('visible'); document.getElementById('cleanOutput').classList.remove('visible'); const TARGET_SCORE = 10; let currentText = text; let currentScore = 100; let round = 0; const FULL_REWRITE_SYSTEM = getModePrompts().rewrite + ` FULL DOCUMENT REWRITE — this is NOT a passage rewrite. Rewrite the ENTIRE text. MANDATORY STRUCTURAL CHANGES: - Verwijderen ALL numbered sections (1. 2. 3. etc) — no numbers, no formal headers - Verwijderen the introduction paragraph that announces what's coming - Verwijderen the conclusion that wraps everything up - Break the text into uneven paragraphs — no perfect structure - If there are 6 sections, make it 4. Or 3. Cut what's weak. - Starten the whole text mid-thought, not with a setup Return the complete rewritten text. No commentary. No explanation. Just the text.`; try { while (currentScore > TARGET_SCORE && round < 3) { round++; loopStatus.textContent = `Full rewrite round ${round}${round > 1 ? ' — score was ' + currentScore : ''}...`; loopFill.style.width = `${Math.min(90, round * 20)}%`; loopScorePill.textContent = round === 1 ? '?' : currentScore; loopScorePill.className = 'score-pill ' + (currentScore >= 60 ? 'risky' : currentScore >= 20 ? 'border' : 'safe'); // Full rewrite const resp = await fetch('https://api.anthropic.com/v1/messages', { method: 'POST', headers: makeHeaders(), body: JSON.stringify({ model: 'claude-haiku-4-5-20251001', max_tokens: 4096, system: FULL_REWRITE_SYSTEM, messages: [{ role: 'user', content: 'Rewrite this entire text:\n\n' + currentText }] }) }); const data = await resp.json(); if (data.error) throw new Fout(data.error.message); currentText = data.content?.find(b => b.type === 'text')?.text || currentText; // Re-analyze loopStatus.textContent = `Round ${round} done — checking score...`; const analyzeResp = await fetch('https://api.anthropic.com/v1/messages', { method: 'POST', headers: makeHeaders(), body: JSON.stringify({ model: 'claude-haiku-4-5-20251001', max_tokens: 800, system: getModePrompts().analyze, messages: [{ role: 'user', content: currentText.slice(0, 3000) }] }) }); const analyzeData = await analyzeResp.json(); const analyzeText = analyzeData.content?.find(b => b.type === 'text')?.text || ''; const s = analyzeText.indexOf('{'); const e = analyzeText.lastIndexOf('}'); if (s !== -1) { const analyzed = JSON.parse(analyzeText.slice(s, e + 1)); currentScore = analyzed.kdp_risk_score || 0; loopScorePill.textContent = currentScore; loopScorePill.className = 'score-pill ' + (currentScore >= 60 ? 'risky' : currentScore >= 20 ? 'border' : 'safe'); if (currentScore <= TARGET_SCORE) break; } else { break; } } loopFill.style.width = '100%'; loopStatus.textContent = currentScore <= TARGET_SCORE ? `✓ Undetectable after ${round} round${round > 1 ? 's' : ''} — score: ${currentScore}/100` : `${round} round${round > 1 ? 's' : ''} — best score: ${currentScore}/100`; var modeLabels = {kdp:'kdp', blog:'blog', email:'email', yt:'yt script', social:'social'}; document.getElementById('cleanOutputTitle').textContent = '✓ full rewrite (' + (modeLabels[_mode]||_mode) + ') — risk: ' + currentScore + '/100'; document.getElementById('cleanTextBox').textContent = currentText.replace(/—/g, ',').replace(/–/g, ','); document.getElementById('cleanOutput').classList.add('visible'); } catch(err) { errorBox.textContent = 'Fout: ' + (err.message || err.toString()); errorBox.classList.add('visible'); } btn.disabled = false; btn.textContent = 'Full Rewrite →'; } async function quickRewrite() { const keyVal = document.getElementById('apiKeyInput') ? document.getElementById('apiKeyInput').value.trim() : ''; if (!keyVal) { document.getElementById('errorBox').textContent = 'Toevoegen your API key first.'; document.getElementById('errorBox').classList.add('visible'); return; } const activeTab = document.getElementById('tab-file').classList.contains('active'); const text = activeTab ? (loadedFileText || '').trim() : document.getElementById('inputText').value.trim(); if (!text) { document.getElementById('errorBox').textContent = 'No text to rewrite.'; document.getElementById('errorBox').classList.add('visible'); return; } const btn = document.getElementById('quickRewriteBtn'); document.getElementById('errorBox').classList.remove('visible'); btn.disabled = true; btn.textContent = 'Rewriting...'; const cleanLoopWrap = document.getElementById('cleanLoopWrap'); const loopScorePill = document.getElementById('loopScorePill'); const loopStatus = document.getElementById('loopStatus'); const loopFill = document.getElementById('loopProgressFill'); cleanLoopWrap.classList.add('visible'); document.getElementById('cleanOutput').classList.remove('visible'); loopScorePill.textContent = '...'; loopScorePill.className = 'score-pill border'; loopStatus.textContent = 'Write Like a Human — one pass...'; loopFill.style.width = '40%'; try { // Detect mode for content type hint const modeHints = { blog: 'Type of content: blog post', email: 'Type of content: email', yt: 'Type of content: YouTube script', social: 'Type of content: social media post', kdp: 'Type of content: book/ebook' }; const hint = modeHints[_mode] || ''; const resp = await fetch('https://api.anthropic.com/v1/messages', { method: 'POST', headers: makeHeaders(), body: JSON.stringify({ model: 'claude-haiku-4-5-20251001', max_tokens: 4096, system: WRITE_LIKE_HUMAN, messages: [{ role: 'user', content: (hint ? hint + '\n\n' : '') + 'Rewrite this text:\n\n' + text }] }) }); const data = await resp.json(); if (data.error) throw new Fout(data.error.message); let rewritten = data.content?.find(b => b.type === 'text')?.text || text; // Strip em dashes client-side rewritten = rewritten.replace(/\u2014/g, ',').replace(/\u2013/g, ','); loopFill.style.width = '70%'; loopStatus.textContent = 'Checking score...'; // Quick analyze for score const analyzeResp = await fetch('https://api.anthropic.com/v1/messages', { method: 'POST', headers: makeHeaders(), body: JSON.stringify({ model: 'claude-haiku-4-5-20251001', max_tokens: 600, system: getModePrompts().analyze, messages: [{ role: 'user', content: rewritten.slice(0, 3000) }] }) }); const aData = await analyzeResp.json(); const aText = aData.content?.find(b => b.type === 'text')?.text || ''; const s = aText.indexOf('{'); const e = aText.lastIndexOf('}'); let score = '?'; if (s !== -1) { try { const parsed = JSON.parse(aText.slice(s, e + 1)); score = parsed.kdp_risk_score ?? '?'; } catch(e) {} } loopFill.style.width = '100%'; loopScorePill.textContent = score; loopScorePill.className = 'score-pill ' + (score >= 60 ? 'risky' : score >= 20 ? 'border' : 'safe'); loopStatus.textContent = 'Klaar — score: ' + score + '/100'; var modeLabels = {kdp:'kdp', blog:'blog', email:'email', yt:'yt script', social:'social'}; document.getElementById('cleanOutputTitle').textContent = '✓ write like a human (' + (modeLabels[_mode]||_mode) + ') — risk: ' + score + '/100'; document.getElementById('cleanTextBox').textContent = rewritten; var co = document.getElementById('cleanOutput'); co.classList.add('visible'); co.scrollIntoView({behavior:'smooth', block:'start'}); } catch(err) { document.getElementById('errorBox').textContent = 'Fout: ' + (err.message || err.toString()); document.getElementById('errorBox').classList.add('visible'); } btn.disabled = false; btn.textContent = 'Write Like Human →'; }