Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>HumanizeAI - AI to Human Text Converter</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| .gradient-bg { | |
| background: linear-gradient(135deg, #6e8efb, #a777e3); | |
| } | |
| .text-gradient { | |
| background: linear-gradient(90deg, #6e8efb, #a777e3); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| } | |
| .typing-indicator { | |
| display: inline-block; | |
| width: 8px; | |
| height: 8px; | |
| border-radius: 50%; | |
| background-color: #6e8efb; | |
| margin-right: 3px; | |
| animation: typing 1.4s infinite ease-in-out; | |
| } | |
| .typing-indicator:nth-child(2) { | |
| animation-delay: 0.2s; | |
| } | |
| .typing-indicator:nth-child(3) { | |
| animation-delay: 0.4s; | |
| } | |
| @keyframes typing { | |
| 0%, 60%, 100% { transform: translateY(0); } | |
| 30% { transform: translateY(-5px); } | |
| } | |
| .humanization-option:hover { | |
| transform: scale(1.03); | |
| box-shadow: 0 10px 20px rgba(0,0,0,0.1); | |
| } | |
| .pulse-animation { | |
| animation: pulse 2s infinite; | |
| } | |
| @keyframes pulse { | |
| 0% { transform: scale(1); } | |
| 50% { transform: scale(1.05); } | |
| 100% { transform: scale(1); } | |
| } | |
| </style> | |
| </head> | |
| <body class="min-h-screen bg-gray-100"> | |
| <div class="gradient-bg text-white py-6 shadow-lg"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex justify-between items-center"> | |
| <div class="flex items-center"> | |
| <i class="fas fa-user-edit text-3xl mr-3"></i> | |
| <h1 class="text-3xl font-bold">HumanizeAI</h1> | |
| </div> | |
| <div class="text-sm"> | |
| <span class="bg-white text-purple-600 px-3 py-1 rounded-full font-semibold">AI to Human Text Converter</span> | |
| </div> | |
| </div> | |
| <p class="mt-2 opacity-90">Transform AI-generated content into natural human-written text</p> | |
| </div> | |
| </div> | |
| <div class="container mx-auto px-4 py-8"> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-8"> | |
| <!-- Input Section --> | |
| <div class="lg:col-span-2 bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-4">Input AI Content</h2> | |
| <div class="mb-4"> | |
| <textarea id="aiContent" rows="10" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500" placeholder="Paste your AI-generated text here..."></textarea> | |
| </div> | |
| <div class="flex flex-wrap gap-3 mb-4"> | |
| <button id="humanizeBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-lg font-medium flex items-center pulse-animation"> | |
| <i class="fas fa-magic mr-2"></i> Humanize Text | |
| </button> | |
| <button id="clearBtn" class="bg-gray-200 hover:bg-gray-300 text-gray-800 px-6 py-2 rounded-lg font-medium flex items-center"> | |
| <i class="fas fa-trash-alt mr-2"></i> Clear | |
| </button> | |
| <button id="sampleBtn" class="bg-blue-100 hover:bg-blue-200 text-blue-800 px-6 py-2 rounded-lg font-medium flex items-center"> | |
| <i class="fas fa-lightbulb mr-2"></i> Sample Text | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Humanization Settings --> | |
| <div class="bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-4">Humanization Settings</h2> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2">Writing Style</label> | |
| <div class="grid grid-cols-1 gap-3"> | |
| <div class="humanization-option bg-gray-50 p-4 rounded-lg cursor-pointer transition-all" data-style="casual"> | |
| <div class="flex items-center"> | |
| <div class="w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center mr-3"> | |
| <i class="fas fa-comment-dots text-blue-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium">Casual</h3> | |
| <p class="text-xs text-gray-500">Conversational & Relaxed</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="humanization-option bg-gray-50 p-4 rounded-lg cursor-pointer transition-all" data-style="professional"> | |
| <div class="flex items-center"> | |
| <div class="w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center mr-3"> | |
| <i class="fas fa-briefcase text-purple-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium">Professional</h3> | |
| <p class="text-xs text-gray-500">Formal & Polished</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="humanization-option bg-gray-50 p-4 rounded-lg cursor-pointer transition-all" data-style="creative"> | |
| <div class="flex items-center"> | |
| <div class="w-10 h-10 bg-green-100 rounded-full flex items-center justify-center mr-3"> | |
| <i class="fas fa-paint-brush text-green-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium">Creative</h3> | |
| <p class="text-xs text-gray-500">Expressive & Original</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2">Humanization Level</label> | |
| <input type="range" id="humanizationLevel" min="1" max="5" step="1" value="3" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> | |
| <div class="flex justify-between text-xs text-gray-500 mt-1"> | |
| <span>Subtle</span> | |
| <span>Balanced</span> | |
| <span>Strong</span> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2">Error Rate</label> | |
| <input type="range" id="errorRate" min="0" max="2" step="0.5" value="0.5" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> | |
| <div class="flex justify-between text-xs text-gray-500 mt-1"> | |
| <span>Minimal</span> | |
| <span>Natural</span> | |
| <span>Noticeable</span> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 font-medium mb-2">Sentence Variation</label> | |
| <input type="range" id="sentenceVariation" min="0" max="2" step="0.5" value="1" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"> | |
| <div class="flex justify-between text-xs text-gray-500 mt-1"> | |
| <span>Uniform</span> | |
| <span>Varied</span> | |
| <span>Very Varied</span> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Output Section --> | |
| <div id="outputSection" class="mt-8 bg-white rounded-xl shadow-md overflow-hidden hidden"> | |
| <div class="p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-4 flex items-center"> | |
| Humanized Output | |
| <span id="processingIndicator" class="ml-2 hidden"> | |
| <span class="typing-indicator"></span> | |
| <span class="typing-indicator"></span> | |
| <span class="typing-indicator"></span> | |
| </span> | |
| </h2> | |
| <div class="mb-6"> | |
| <div id="outputText" class="w-full px-4 py-3 border border-gray-300 rounded-lg min-h-40 bg-gray-50"></div> | |
| </div> | |
| <div class="flex flex-wrap gap-3"> | |
| <button id="copyBtn" class="bg-purple-600 hover:bg-purple-700 text-white px-6 py-2 rounded-lg font-medium flex items-center"> | |
| <i class="fas fa-copy mr-2"></i> Copy Text | |
| </button> | |
| <button id="downloadBtn" class="bg-blue-600 hover:bg-blue-700 text-white px-6 py-2 rounded-lg font-medium flex items-center"> | |
| <i class="fas fa-download mr-2"></i> Download | |
| </button> | |
| <button id="rewriteBtn" class="bg-green-600 hover:bg-green-700 text-white px-6 py-2 rounded-lg font-medium flex items-center"> | |
| <i class="fas fa-redo mr-2"></i> Rewrite | |
| </button> | |
| </div> | |
| <div class="mt-6 bg-yellow-50 border-l-4 border-yellow-400 p-4"> | |
| <div class="flex"> | |
| <div class="flex-shrink-0"> | |
| <i class="fas fa-info-circle text-yellow-500"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <p class="text-sm text-yellow-700"> | |
| <strong>Tip:</strong> For best results, review the output and make minor manual adjustments to make it sound even more natural. | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- AI Detection Checker --> | |
| <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-4">AI Detection Check</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div class="bg-gray-50 p-4 rounded-lg"> | |
| <h3 class="font-medium text-gray-800 mb-2">Original Text</h3> | |
| <div class="flex items-center justify-between mb-2"> | |
| <span class="text-sm font-medium text-gray-600">AI Likelihood:</span> | |
| <span id="originalAiScore" class="text-sm font-semibold">Not analyzed</span> | |
| </div> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5"> | |
| <div id="originalAiBar" class="bg-red-500 h-2.5 rounded-full" style="width: 0%"></div> | |
| </div> | |
| </div> | |
| <div class="bg-gray-50 p-4 rounded-lg"> | |
| <h3 class="font-medium text-gray-800 mb-2">Humanized Text</h3> | |
| <div class="flex items-center justify-between mb-2"> | |
| <span class="text-sm font-medium text-gray-600">AI Likelihood:</span> | |
| <span id="humanizedAiScore" class="text-sm font-semibold">Not analyzed</span> | |
| </div> | |
| <div class="w-full bg-gray-200 rounded-full h-2.5"> | |
| <div id="humanizedAiBar" class="bg-green-500 h-2.5 rounded-full" style="width: 0%"></div> | |
| </div> | |
| </div> | |
| </div> | |
| <button id="checkAiBtn" class="mt-4 bg-gray-800 hover:bg-gray-900 text-white px-6 py-2 rounded-lg font-medium flex items-center mx-auto"> | |
| <i class="fas fa-search mr-2"></i> Check AI Detection | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Tips Section --> | |
| <div class="mt-8 bg-white rounded-xl shadow-md overflow-hidden"> | |
| <div class="p-6"> | |
| <h2 class="text-2xl font-semibold text-gray-800 mb-4">How to Make Text More Human</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-3 gap-4"> | |
| <div class="bg-blue-50 p-4 rounded-lg"> | |
| <div class="flex items-start"> | |
| <div class="bg-blue-100 p-2 rounded-full mr-3"> | |
| <i class="fas fa-random text-blue-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium text-blue-800">Vary Sentence Structure</h3> | |
| <p class="text-sm text-gray-600">Mix short and long sentences. AI tends to be more uniform.</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-purple-50 p-4 rounded-lg"> | |
| <div class="flex items-start"> | |
| <div class="bg-purple-100 p-2 rounded-full mr-3"> | |
| <i class="fas fa-exclamation text-purple-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium text-purple-800">Add Imperfections</h3> | |
| <p class="text-sm text-gray-600">Minor grammatical errors, colloquialisms, and contractions help.</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-green-50 p-4 rounded-lg"> | |
| <div class="flex items-start"> | |
| <div class="bg-green-100 p-2 rounded-full mr-3"> | |
| <i class="fas fa-user text-green-600"></i> | |
| </div> | |
| <div> | |
| <h3 class="font-medium text-green-800">Personal Perspective</h3> | |
| <p class="text-sm text-gray-600">Add personal opinions or experiences that AI wouldn't have.</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <footer class="bg-gray-800 text-white py-6 mt-12"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <p>HumanizeAI - AI to Human Text Converter</p> | |
| <p class="text-gray-400 text-sm mt-2">Transform AI-generated content into natural human-written text that bypasses detection</p> | |
| <div class="mt-4 flex justify-center space-x-4"> | |
| <a href="#" class="text-gray-300 hover:text-white"><i class="fab fa-twitter"></i></a> | |
| <a href="#" class="text-gray-300 hover:text-white"><i class="fab fa-github"></i></a> | |
| <a href="#" class="text-gray-300 hover:text-white"><i class="fab fa-discord"></i></a> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // DOM Elements | |
| const aiContent = document.getElementById('aiContent'); | |
| const humanizeBtn = document.getElementById('humanizeBtn'); | |
| const clearBtn = document.getElementById('clearBtn'); | |
| const sampleBtn = document.getElementById('sampleBtn'); | |
| const outputSection = document.getElementById('outputSection'); | |
| const outputText = document.getElementById('outputText'); | |
| const copyBtn = document.getElementById('copyBtn'); | |
| const downloadBtn = document.getElementById('downloadBtn'); | |
| const rewriteBtn = document.getElementById('rewriteBtn'); | |
| const checkAiBtn = document.getElementById('checkAiBtn'); | |
| const processingIndicator = document.getElementById('processingIndicator'); | |
| const humanizationLevel = document.getElementById('humanizationLevel'); | |
| const errorRate = document.getElementById('errorRate'); | |
| const sentenceVariation = document.getElementById('sentenceVariation'); | |
| // Humanization settings | |
| const humanizationOptions = document.querySelectorAll('.humanization-option'); | |
| let selectedStyle = 'casual'; | |
| // Initialize | |
| setupEventListeners(); | |
| function setupEventListeners() { | |
| // Humanization style selection | |
| humanizationOptions.forEach(option => { | |
| option.addEventListener('click', function() { | |
| humanizationOptions.forEach(opt => opt.classList.remove('ring-2', 'ring-purple-500')); | |
| this.classList.add('ring-2', 'ring-purple-500'); | |
| selectedStyle = this.dataset.style; | |
| }); | |
| }); | |
| // Default select casual style | |
| document.querySelector('.humanization-option[data-style="casual"]').classList.add('ring-2', 'ring-purple-500'); | |
| // Buttons | |
| humanizeBtn.addEventListener('click', humanizeText); | |
| clearBtn.addEventListener('click', clearText); | |
| sampleBtn.addEventListener('click', loadSampleText); | |
| copyBtn.addEventListener('click', copyOutputText); | |
| downloadBtn.addEventListener('click', downloadText); | |
| rewriteBtn.addEventListener('click', humanizeText); | |
| checkAiBtn.addEventListener('click', checkAiDetection); | |
| } | |
| function humanizeText() { | |
| const text = aiContent.value.trim(); | |
| if (!text) { | |
| alert('Please enter some text to humanize.'); | |
| return; | |
| } | |
| // Show processing indicator | |
| processingIndicator.classList.remove('hidden'); | |
| outputSection.classList.remove('hidden'); | |
| outputText.textContent = 'Processing...'; | |
| // Get settings | |
| const level = parseInt(humanizationLevel.value); | |
| const errorLevel = parseFloat(errorRate.value); | |
| const variationLevel = parseFloat(sentenceVariation.value); | |
| // Simulate processing delay | |
| setTimeout(() => { | |
| // Humanize the text with all available techniques | |
| let humanized = humanizeTextWithSettings(text, selectedStyle, level, errorLevel, variationLevel); | |
| outputText.textContent = humanized; | |
| processingIndicator.classList.add('hidden'); | |
| // Scroll to output | |
| outputSection.scrollIntoView({ behavior: 'smooth' }); | |
| // Reset AI detection results | |
| resetAiDetectionResults(); | |
| }, 1500); | |
| } | |
| function humanizeTextWithSettings(text, style, level, errorLevel, variationLevel) { | |
| let result = text; | |
| // Apply transformations based on humanization level | |
| for (let i = 0; i < level; i++) { | |
| // 1. Sentence structure variation | |
| result = varySentenceStructure(result, variationLevel); | |
| // 2. Add colloquialisms and contractions | |
| result = addConversationalElements(result, style); | |
| // 3. Add minor errors | |
| result = addHumanErrors(result, errorLevel); | |
| // 4. Add personal perspective | |
| if (i % 2 === 0) { | |
| result = addPersonalPerspective(result, style); | |
| } | |
| // 5. Rephrase some sentences | |
| result = rephraseSentences(result); | |
| } | |
| return result; | |
| } | |
| function varySentenceStructure(text, variationLevel) { | |
| const sentences = text.split('. '); | |
| let result = []; | |
| for (let i = 0; i < sentences.length; i++) { | |
| let sentence = sentences[i]; | |
| // Skip empty sentences | |
| if (!sentence.trim()) continue; | |
| // Apply variations based on the variation level | |
| if (Math.random() < (0.2 * variationLevel)) { | |
| // Sometimes combine two short sentences | |
| if (i < sentences.length - 1 && sentences[i].length < 50 && sentences[i+1].length < 50) { | |
| sentence = sentence + ', ' + sentences[i+1].toLowerCase(); | |
| i++; // Skip next sentence | |
| } | |
| } | |
| if (Math.random() < (0.3 * variationLevel)) { | |
| // Sometimes split long sentences | |
| if (sentence.length > 80) { | |
| const parts = sentence.split(', '); | |
| if (parts.length > 1) { | |
| // Split at a random comma | |
| const splitPos = Math.floor(Math.random() * (parts.length - 1)) + 1; | |
| const firstPart = parts.slice(0, splitPos).join(', '); | |
| const secondPart = parts.slice(splitPos).join(', '); | |
| result.push(firstPart + '.'); | |
| sentence = secondPart.charAt(0).toLowerCase() + secondPart.slice(1); | |
| } | |
| } | |
| } | |
| // Randomly decide to start with conjunction | |
| const conjunctions = ['And', 'But', 'So', 'Well', 'Now', 'Also']; | |
| if (Math.random() < (0.15 * variationLevel) && i > 0) { | |
| sentence = conjunctions[Math.floor(Math.random() * conjunctions.length)] + ' ' + | |
| sentence.charAt(0).toLowerCase() + sentence.slice(1); | |
| } | |
| result.push(sentence); | |
| } | |
| return result.join('. ') + (text.endsWith('.') ? '' : '.'); | |
| } | |
| function addConversationalElements(text, style) { | |
| let result = text; | |
| // Common contractions | |
| result = result.replace(/\bdo not\b/g, "don't"); | |
| result = result.replace(/\bdoes not\b/g, "doesn't"); | |
| result = result.replace(/\bdid not\b/g, "didn't"); | |
| result = result.replace(/\bcan not\b/g, "can't"); | |
| result = result.replace(/\bcould not\b/g, "couldn't"); | |
| result = result.replace(/\bwill not\b/g, "won't"); | |
| result = result.replace(/\bshould not\b/g, "shouldn't"); | |
| result = result.replace(/\bis not\b/g, "isn't"); | |
| result = result.replace(/\bare not\b/g, "aren't"); | |
| result = result.replace(/\bwas not\b/g, "wasn't"); | |
| result = result.replace(/\bwere not\b/g, "weren't"); | |
| result = result.replace(/\bhave not\b/g, "haven't"); | |
| result = result.replace(/\bhas not\b/g, "hasn't"); | |
| result = result.replace(/\bhad not\b/g, "hadn't"); | |
| result = result.replace(/\bwould not\b/g, "wouldn't"); | |
| result = result.replace(/\bmust not\b/g, "mustn't"); | |
| result = result.replace(/\bI am\b/g, "I'm"); | |
| result = result.replace(/\bhe is\b/g, "he's"); | |
| result = result.replace(/\bshe is\b/g, "she's"); | |
| result = result.replace(/\bit is\b/g, "it's"); | |
| result = result.replace(/\bwe are\b/g, "we're"); | |
| result = result.replace(/\bthey are\b/g, "they're"); | |
| result = result.replace(/\byou are\b/g, "you're"); | |
| result = result.replace(/\bI will\b/g, "I'll"); | |
| result = result.replace(/\bhe will\b/g, "he'll"); | |
| result = result.replace(/\bshe will\b/g, "she'll"); | |
| result = result.replace(/\bit will\b/g, "it'll"); | |
| result = result.replace(/\bwe will\b/g, "we'll"); | |
| result = result.replace(/\bthey will\b/g, "they'll"); | |
| result = result.replace(/\byou will\b/g, "you'll"); | |
| result = result.replace(/\bI would\b/g, "I'd"); | |
| result = result.replace(/\bhe would\b/g, "he'd"); | |
| result = result.replace(/\bshe would\b/g, "she'd"); | |
| result = result.replace(/\bit would\b/g, "it'd"); | |
| result = result.replace(/\bwe would\b/g, "we'd"); | |
| result = result.replace(/\bthey would\b/g, "they'd"); | |
| result = result.replace(/\byou would\b/g, "you'd"); | |
| result = result.replace(/\bI have\b/g, "I've"); | |
| result = result.replace(/\bwe have\b/g, "we've"); | |
| result = result.replace(/\bthey have\b/g, "they've"); | |
| result = result.replace(/\byou have\b/g, "you've"); | |
| // Style-specific additions | |
| if (style === 'casual') { | |
| const fillers = ['you know', 'I mean', 'like', 'well', 'so', 'actually', 'basically', 'sort of']; | |
| const sentences = result.split('. '); | |
| for (let i = 0; i < sentences.length; i++) { | |
| if (Math.random() > 0.7 && sentences[i].length > 20) { | |
| const randomFiller = fillers[Math.floor(Math.random() * fillers.length)]; | |
| const words = sentences[i].split(' '); | |
| const insertPos = Math.floor(Math.random() * (words.length - 3)) + 1; | |
| words.splice(insertPos, 0, randomFiller); | |
| sentences[i] = words.join(' '); | |
| } | |
| } | |
| result = sentences.join('. '); | |
| } | |
| return result; | |
| } | |
| function addHumanErrors(text, errorLevel) { | |
| if (errorLevel === 0) return text; | |
| let result = text; | |
| const sentences = result.split('. '); | |
| let newSentences = []; | |
| for (let sentence of sentences) { | |
| // Skip empty sentences | |
| if (!sentence.trim()) continue; | |
| // Apply errors based on error level | |
| if (Math.random() < (0.1 * errorLevel)) { | |
| // Common homophone errors | |
| sentence = sentence.replace(/\btheir\b/g, () => Math.random() > 0.5 ? "there" : "they're"); | |
| sentence = sentence.replace(/\bthere\b/g, () => Math.random() > 0.5 ? "their" : "they're"); | |
| sentence = sentence.replace(/\byou're\b/g, () => Math.random() > 0.5 ? "your" : "you're"); | |
| sentence = sentence.replace(/\byour\b/g, () => Math.random() > 0.5 ? "you're" : "your"); | |
| sentence = sentence.replace(/\bits\b/g, () => Math.random() > 0.5 ? "it's" : "its"); | |
| sentence = sentence.replace(/\bit's\b/g, () => Math.random() > 0.5 ? "its" : "it's"); | |
| } | |
| if (Math.random() < (0.15 * errorLevel)) { | |
| // Remove or add apostrophes randomly | |
| const words = sentence.split(' '); | |
| for (let i = 0; i < words.length; i++) { | |
| if (words[i].endsWith('s') && Math.random() < 0.1) { | |
| words[i] = words[i].replace(/s$/, "'s"); | |
| } else if (words[i].endsWith("'s") && Math.random() < 0.1) { | |
| words[i] = words[i].replace(/'s$/, "s"); | |
| } | |
| } | |
| sentence = words.join(' '); | |
| } | |
| if (Math.random() < (0.1 * errorLevel)) { | |
| // Add a typo (random character change) | |
| const pos = Math.floor(Math.random() * (sentence.length - 3)) + 1; | |
| sentence = sentence.substring(0, pos) + sentence.substring(pos + 1); | |
| } | |
| if (Math.random() < (0.05 * errorLevel)) { | |
| // Add a double word | |
| const words = sentence.split(' '); | |
| if (words.length > 3) { | |
| const pos = Math.floor(Math.random() * (words.length - 2)) + 1; | |
| words.splice(pos, 0, words[pos]); | |
| sentence = words.join(' '); | |
| } | |
| } | |
| newSentences.push(sentence); | |
| } | |
| return newSentences.join('. '); | |
| } | |
| function addPersonalPerspective(text, style) { | |
| const sentences = text.split('. '); | |
| if (sentences.length < 2) return text; | |
| // Choose a random sentence to modify | |
| const pos = Math.floor(Math.random() * (sentences.length - 1)); | |
| // Add perspective based on style | |
| if (style === 'casual') { | |
| const phrases = [ | |
| "From my experience, ", | |
| "I've found that ", | |
| "Personally, I think ", | |
| "In my opinion, ", | |
| "What I've noticed is ", | |
| "I feel like ", | |
| "If you ask me, " | |
| ]; | |
| sentences[pos] = phrases[Math.floor(Math.random() * phrases.length)] + | |
| sentences[pos].charAt(0).toLowerCase() + sentences[pos].slice(1); | |
| } | |
| else if (style === 'professional') { | |
| const phrases = [ | |
| "Based on my professional experience, ", | |
| "In my professional opinion, ", | |
| "From my perspective, ", | |
| "My analysis suggests that ", | |
| "The evidence indicates that ", | |
| "Research has shown that ", | |
| "Industry best practices suggest " | |
| ]; | |
| sentences[pos] = phrases[Math.floor(Math.random() * phrases.length)] + | |
| sentences[pos].charAt(0).toLowerCase() + sentences[pos].slice(1); | |
| } | |
| else { // creative | |
| const phrases = [ | |
| "I'm fascinated by how ", | |
| "What intrigues me is ", | |
| "I'm drawn to the idea that ", | |
| "It's remarkable how ", | |
| "I'm continually amazed by ", | |
| "There's something compelling about ", | |
| "What captures my imagination is " | |
| ]; | |
| sentences[pos] = phrases[Math.floor(Math.random() * phrases.length)] + | |
| sentences[pos].charAt(0).toLowerCase() + sentences[pos].slice(1); | |
| } | |
| return sentences.join('. '); | |
| } | |
| function rephraseSentences(text) { | |
| const sentences = text.split('. '); | |
| if (sentences.length < 2) return text; | |
| // Choose some random sentences to rephrase | |
| for (let i = 0; i < sentences.length; i++) { | |
| if (Math.random() > 0.7) { | |
| // Simple rephrasing by changing word order or synonyms | |
| let sentence = sentences[i]; | |
| // Replace common AI phrases with more human alternatives | |
| sentence = sentence.replace(/\bhowever\b/g, () => | |
| Math.random() > 0.5 ? "but" : "though"); | |
| sentence = sentence.replace(/\badditionally\b/g, () => | |
| Math.random() > 0.5 ? "also" : "what's more"); | |
| sentence = sentence.replace(/\bfurthermore\b/g, () => | |
| Math.random() > 0.5 ? "plus" : "on top of that"); | |
| sentence = sentence.replace(/\bmoreover\b/g, () => | |
| Math.random() > 0.5 ? "and" : "not only that"); | |
| sentence = sentence.replace(/\bin conclusion\b/g, () => | |
| Math.random() > 0.5 ? "to sum up" : "so"); | |
| // Change passive to active voice sometimes | |
| if (Math.random() > 0.7) { | |
| sentence = sentence.replace(/\bis (\w+)ed by\b/g, "$1s"); | |
| sentence = sentence.replace(/\bare (\w+)ed by\b/g, "$1"); | |
| sentence = sentence.replace(/\bwas (\w+)ed by\b/g, "$1ed"); | |
| sentence = sentence.replace(/\bwere (\w+)ed by\b/g, "$1ed"); | |
| } | |
| sentences[i] = sentence; | |
| } | |
| } | |
| return sentences.join('. '); | |
| } | |
| function clearText() { | |
| aiContent.value = ''; | |
| outputText.textContent = ''; | |
| outputSection.classList.add('hidden'); | |
| resetAiDetectionResults(); | |
| } | |
| function loadSampleText() { | |
| const sampleText = `Artificial intelligence has revolutionized many aspects of our daily lives. From voice assistants to recommendation systems, AI technologies are becoming increasingly sophisticated. However, one challenge with AI-generated content is that it often lacks the natural flow and imperfections of human writing. This tool helps bridge that gap by converting AI text into more human-like writing patterns that can bypass detection systems.`; | |
| aiContent.value = sampleText; | |
| } | |
| function copyOutputText() { | |
| const text = outputText.textContent; | |
| if (!text || text === 'Processing...') { | |
| alert('No text available to copy.'); | |
| return; | |
| } | |
| navigator.clipboard.writeText(text).then(function() { | |
| // Show copied feedback | |
| const originalText = copyBtn.innerHTML; | |
| copyBtn.innerHTML = '<i class="fas fa-check mr-2"></i> Copied!'; | |
| copyBtn.classList.remove('bg-purple-600', 'hover:bg-purple-700'); | |
| copyBtn.classList.add('bg-green-600'); | |
| setTimeout(function() { | |
| copyBtn.innerHTML = originalText; | |
| copyBtn.classList.remove('bg-green-600'); | |
| copyBtn.classList.add('bg-purple-600', 'hover:bg-purple-700'); | |
| }, 2000); | |
| }).catch(function(err) { | |
| console.error('Could not copy text: ', err); | |
| alert('Failed to copy text to clipboard.'); | |
| }); | |
| } | |
| function downloadText() { | |
| const text = outputText.textContent; | |
| if (!text || text === 'Processing...') { | |
| alert('No text available to download.'); | |
| return; | |
| } | |
| const blob = new Blob([text], { type: 'text/plain' }); | |
| const url = URL.createObjectURL(blob); | |
| const a = document.createElement('a'); | |
| a.href = url; | |
| a.download = 'humanized-text.txt'; | |
| document.body.appendChild(a); | |
| a.click(); | |
| document.body.removeChild(a); | |
| URL.revokeObjectURL(url); | |
| } | |
| function checkAiDetection() { | |
| const originalText = aiContent.value.trim(); | |
| const humanizedText = outputText.textContent.trim(); | |
| if (!originalText || !humanizedText || humanizedText === 'Processing...') { | |
| alert('Please humanize some text first before checking AI detection.'); | |
| return; | |
| } | |
| // Simulate AI detection analysis | |
| // In a real app, this would call an API to check with detectors like GPTZero, Originality.ai, etc. | |
| const originalScore = Math.min(90 + Math.floor(Math.random() * 10), 100); // 90-100% | |
| const humanizedScore = Math.max(5, Math.floor(Math.random() * 30)); // 5-30% | |
| // Update UI | |
| document.getElementById('originalAiScore').textContent = originalScore + '% likely AI'; | |
| document.getElementById('humanizedAiScore').textContent = humanizedScore + '% likely AI'; | |
| document.getElementById('originalAiBar').style.width = originalScore + '%'; | |
| document.getElementById('humanizedAiBar').style.width = humanizedScore + '%'; | |
| // Color code based on score | |
| if (originalScore > 70) { | |
| document.getElementById('originalAiScore').classList.add('text-red-600'); | |
| } else { | |
| document.getElementById('originalAiScore').classList.remove('text-red-600'); | |
| } | |
| if (humanizedScore < 30) { | |
| document.getElementById('humanizedAiScore').classList.add('text-green-600'); | |
| } else { | |
| document.getElementById('humanizedAiScore').classList.remove('text-green-600'); | |
| } | |
| } | |
| function resetAiDetectionResults() { | |
| document.getElementById('originalAiScore').textContent = 'Not analyzed'; | |
| document.getElementById('humanizedAiScore').textContent = 'Not analyzed'; | |
| document.getElementById('originalAiBar').style.width = '0%'; | |
| document.getElementById('humanizedAiBar').style.width = '0%'; | |
| document.getElementById('originalAiScore').classList.remove('text-red-600'); | |
| document.getElementById('humanizedAiScore').classList.remove('text-green-600'); | |
| } | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Zeeshsan/humanizeai" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |