-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
251 lines (218 loc) · 8.66 KB
/
index.html
File metadata and controls
251 lines (218 loc) · 8.66 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>VENBA AI | AI Text Humanizer</title>
<script src="https://js.puter.com/v2/"></script>
<style>
body {
font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
color: #333;
}
h1 {
color: #6d28d9;
text-align: center;
margin-bottom: 30px;
}
.container {
background: #f7f7f8;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
textarea {
width: 100%;
min-height: 150px;
padding: 15px;
border: 1px solid #ddd;
border-radius: 8px;
resize: vertical;
font-family: inherit;
font-size: 16px;
margin-bottom: 15px;
}
.controls {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 15px;
}
button {
background: #6d28d9;
color: white;
border: none;
padding: 10px 15px;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
transition: background 0.2s;
}
button:hover {
background: #5b21b6;
}
button.secondary {
background: #e5e5e5;
color: #333;
}
button.secondary:hover {
background: #d1d1d1;
}
.mode-selector {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-bottom: 15px;
}
.mode-btn {
background: #e5e5e5;
color: #333;
border: none;
padding: 8px 12px;
border-radius: 20px;
cursor: pointer;
font-size: 13px;
}
.mode-btn.active {
background: #6d28d9;
color: white;
}
.output {
margin-top: 20px;
padding: 15px;
background: white;
border-radius: 8px;
border: 1px solid #ddd;
min-height: 100px;
white-space: pre-wrap;
}
.loading {
color: #666;
font-style: italic;
}
.word-count {
font-size: 13px;
color: #666;
text-align: right;
margin-bottom: 10px;
}
</style>
</head>
<body>
<h1>VENBA AI Text Humanizer</h1>
<div class="container">
<textarea id="input-text" placeholder="Paste your AI-generated text here..."></textarea>
<div class="word-count" id="word-counter">0 words</div>
<div class="mode-selector" id="mode-selector">
<!-- Modes will be added by JavaScript -->
</div>
<div class="controls">
<button id="humanize-btn">Humanize Text</button>
<button class="secondary" id="clear-btn">Clear</button>
<button class="secondary" id="copy-btn">Copy Result</button>
</div>
<div class="output" id="output">
<div class="loading">Your humanized text will appear here...</div>
</div>
</div>
<script>
// Initialize the app
document.addEventListener('DOMContentLoaded', function() {
const inputText = document.getElementById('input-text');
const humanizeBtn = document.getElementById('humanize-btn');
const clearBtn = document.getElementById('clear-btn');
const copyBtn = document.getElementById('copy-btn');
const outputDiv = document.getElementById('output');
const wordCounter = document.getElementById('word-counter');
const modeSelector = document.getElementById('mode-selector');
// Available humanization modes
const humanizationModes = [
{ id: 'standard', name: 'Standard', icon: '★' },
{ id: 'formal', name: 'Formal', icon: '👔' },
{ id: 'casual', name: 'Casual', icon: '😊' },
{ id: 'simplify', name: 'Simplify', icon: '🔍' },
{ id: 'expand', name: 'Expand', icon: '📝' },
{ id: 'academic', name: 'Academic', icon: '🎓' }
];
// Current settings
let currentMode = 'standard';
// Create mode buttons
humanizationModes.forEach(mode => {
const btn = document.createElement('button');
btn.className = `mode-btn ${mode.id === currentMode ? 'active' : ''}`;
btn.innerHTML = `${mode.icon} ${mode.name}`;
btn.dataset.mode = mode.id;
btn.addEventListener('click', () => {
currentMode = mode.id;
document.querySelectorAll('.mode-btn').forEach(b => {
b.classList.toggle('active', b.dataset.mode === mode.id);
});
});
modeSelector.appendChild(btn);
});
// Update word count
inputText.addEventListener('input', function() {
const text = inputText.value.trim();
const wordCount = text ? text.split(/\s+/).length : 0;
wordCounter.textContent = `${wordCount} words`;
// Disable button if over limit (300 words)
humanizeBtn.disabled = wordCount > 300;
if (wordCount > 300) {
wordCounter.innerHTML += ' <span style="color:#ef4444">(Max 300)</span>';
}
});
// Humanize text
humanizeBtn.addEventListener('click', async function() {
const text = inputText.value.trim();
if (!text) {
outputDiv.innerHTML = '<div style="color:#ef4444">Please enter some text to humanize</div>';
return;
}
if (text.split(/\s+/).length > 300) {
outputDiv.innerHTML = '<div style="color:#ef4444">Text exceeds 300 word limit</div>';
return;
}
outputDiv.innerHTML = '<div class="loading">Humanizing text... (usually takes 5-10 seconds)</div>';
try {
const prompt = `Humanize this AI-generated text to make it sound natural and human-written.
Apply the ${currentMode} style while preserving the original meaning.
The text should bypass AI detectors like GPTZero and Turnitin.
Return only the humanized text without additional commentary.
Text to humanize: ${text}`;
const response = await puter.ai.chat(prompt, {
model: 'openrouter:anthropic/claude-3.5-sonnet'
});
outputDiv.innerHTML = `<div>${response}</div>`;
} catch (error) {
outputDiv.innerHTML = `<div style="color:#ef4444">Error: ${error.message || 'Failed to humanize text'}</div>`;
}
});
// Clear button
clearBtn.addEventListener('click', function() {
inputText.value = '';
outputDiv.innerHTML = '<div class="loading">Your humanized text will appear here...</div>';
wordCounter.textContent = '0 words';
humanizeBtn.disabled = false;
});
// Copy button
copyBtn.addEventListener('click', function() {
const resultText = outputDiv.textContent;
if (resultText && !resultText.includes('Your humanized text')) {
navigator.clipboard.writeText(resultText)
.then(() => {
const originalText = copyBtn.textContent;
copyBtn.textContent = 'Copied!';
setTimeout(() => {
copyBtn.textContent = originalText;
}, 2000);
});
}
});
});
</script>
</body>
</html>