r5serqwe

Untitled

Jun 17th, 2025
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.12 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Unicode Text Obfuscator</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13.  
  14. body {
  15. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  16. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  17. min-height: 100vh;
  18. padding: 20px;
  19. }
  20.  
  21. .container {
  22. max-width: 1200px;
  23. margin: 0 auto;
  24. background: white;
  25. border-radius: 15px;
  26. box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  27. overflow: hidden;
  28. }
  29.  
  30. .header {
  31. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  32. color: white;
  33. padding: 30px;
  34. text-align: center;
  35. }
  36.  
  37. .header h1 {
  38. font-size: 2.5em;
  39. margin-bottom: 10px;
  40. text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  41. }
  42.  
  43. .header p {
  44. opacity: 0.9;
  45. font-size: 1.1em;
  46. }
  47.  
  48. .main-content {
  49. padding: 30px;
  50. }
  51.  
  52. .section {
  53. margin-bottom: 30px;
  54. padding: 20px;
  55. border-radius: 10px;
  56. background: #f8f9fa;
  57. border-left: 4px solid #667eea;
  58. }
  59.  
  60. .section h2 {
  61. color: #333;
  62. margin-bottom: 15px;
  63. font-size: 1.3em;
  64. }
  65.  
  66. .input-group {
  67. margin-bottom: 20px;
  68. }
  69.  
  70. .input-group label {
  71. display: block;
  72. margin-bottom: 5px;
  73. font-weight: 600;
  74. color: #555;
  75. }
  76.  
  77. textarea {
  78. width: 100%;
  79. min-height: 120px;
  80. padding: 15px;
  81. border: 2px solid #ddd;
  82. border-radius: 8px;
  83. font-family: 'Courier New', monospace;
  84. font-size: 14px;
  85. resize: vertical;
  86. transition: border-color 0.3s;
  87. }
  88.  
  89. textarea:focus {
  90. outline: none;
  91. border-color: #667eea;
  92. }
  93.  
  94. .controls-grid {
  95. display: grid;
  96. grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  97. gap: 20px;
  98. margin-bottom: 20px;
  99. }
  100.  
  101. .checkbox-group {
  102. display: grid;
  103. grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  104. gap: 10px;
  105. }
  106.  
  107. .checkbox-item {
  108. display: flex;
  109. align-items: center;
  110. padding: 10px;
  111. background: white;
  112. border-radius: 6px;
  113. border: 1px solid #ddd;
  114. transition: all 0.3s;
  115. cursor: pointer;
  116. user-select: none;
  117. }
  118.  
  119. .checkbox-item:hover {
  120. background: #f0f0f0;
  121. border-color: #667eea;
  122. }
  123.  
  124. .checkbox-item input[type="checkbox"] {
  125. margin-right: 10px;
  126. transform: scale(1.2);
  127. pointer-events: none;
  128. }
  129.  
  130. .checkbox-item label {
  131. margin: 0;
  132. cursor: pointer;
  133. flex: 1;
  134. }
  135.  
  136. .slider-container {
  137. margin: 20px 0;
  138. }
  139.  
  140. .slider {
  141. width: 100%;
  142. height: 8px;
  143. border-radius: 4px;
  144. background: #ddd;
  145. outline: none;
  146. -webkit-appearance: none;
  147. }
  148.  
  149. .slider::-webkit-slider-thumb {
  150. -webkit-appearance: none;
  151. appearance: none;
  152. width: 20px;
  153. height: 20px;
  154. border-radius: 50%;
  155. background: #667eea;
  156. cursor: pointer;
  157. }
  158.  
  159. .slider::-moz-range-thumb {
  160. width: 20px;
  161. height: 20px;
  162. border-radius: 50%;
  163. background: #667eea;
  164. cursor: pointer;
  165. border: none;
  166. }
  167.  
  168. .slider-value {
  169. text-align: center;
  170. font-weight: bold;
  171. color: #667eea;
  172. margin-top: 10px;
  173. }
  174.  
  175. .button-group {
  176. display: flex;
  177. gap: 15px;
  178. flex-wrap: wrap;
  179. justify-content: center;
  180. margin: 20px 0;
  181. }
  182.  
  183. button {
  184. padding: 12px 25px;
  185. border: none;
  186. border-radius: 8px;
  187. font-size: 16px;
  188. font-weight: 600;
  189. cursor: pointer;
  190. transition: all 0.3s;
  191. text-transform: uppercase;
  192. letter-spacing: 1px;
  193. }
  194.  
  195. .btn-primary {
  196. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  197. color: white;
  198. }
  199.  
  200. .btn-primary:hover {
  201. transform: translateY(-2px);
  202. box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  203. }
  204.  
  205. .btn-secondary {
  206. background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  207. color: #333;
  208. }
  209.  
  210. .btn-secondary:hover {
  211. transform: translateY(-2px);
  212. box-shadow: 0 5px 15px rgba(252, 182, 159, 0.4);
  213. }
  214.  
  215. .seed-display {
  216. text-align: center;
  217. padding: 15px;
  218. background: #fff3cd;
  219. border-radius: 8px;
  220. margin: 20px 0;
  221. border: 1px solid #ffeaa7;
  222. }
  223.  
  224. .seed-display strong {
  225. color: #856404;
  226. }
  227.  
  228. .json-section {
  229. margin-top: 30px;
  230. padding: 20px;
  231. background: #f1f3f4;
  232. border-radius: 10px;
  233. }
  234.  
  235. .json-input {
  236. width: 100%;
  237. min-height: 100px;
  238. padding: 15px;
  239. border: 2px solid #ddd;
  240. border-radius: 8px;
  241. font-family: 'Courier New', monospace;
  242. font-size: 14px;
  243. background: white;
  244. }
  245.  
  246. .stats {
  247. display: grid;
  248. grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  249. gap: 15px;
  250. margin: 20px 0;
  251. }
  252.  
  253. .stat-item {
  254. text-align: center;
  255. padding: 15px;
  256. background: white;
  257. border-radius: 8px;
  258. border: 1px solid #ddd;
  259. }
  260.  
  261. .stat-value {
  262. font-size: 1.5em;
  263. font-weight: bold;
  264. color: #667eea;
  265. }
  266.  
  267. .stat-label {
  268. color: #666;
  269. font-size: 0.9em;
  270. }
  271.  
  272. .mode-section {
  273. display: grid;
  274. grid-template-columns: 1fr 1fr;
  275. gap: 20px;
  276. }
  277.  
  278. @media (max-width: 768px) {
  279. .mode-section {
  280. grid-template-columns: 1fr;
  281. }
  282. .controls-grid {
  283. grid-template-columns: 1fr;
  284. }
  285. }
  286. </style>
  287. </head>
  288. <body>
  289. <div class="container">
  290. <div class="header">
  291. <h1>🔀 Unicode Text Obfuscator</h1>
  292. <p>Transform text with Unicode look-alikes and special characters</p>
  293. </div>
  294.  
  295. <div class="main-content">
  296. <div class="section">
  297. <h2>📝 Input Text</h2>
  298. <div class="input-group">
  299. <label for="inputText">Enter your text:</label>
  300. <textarea id="inputText" placeholder="Type or paste your text here...">Hello World! This is a test text with numbers 12345 and symbols.</textarea>
  301. </div>
  302. </div>
  303.  
  304. <div class="section">
  305. <h2>⚙️ Obfuscation Settings</h2>
  306. <div class="controls-grid">
  307. <div class="mode-section">
  308. <div>
  309. <h3>Character Types</h3>
  310. <div class="checkbox-group">
  311. <div class="checkbox-item" onclick="toggleCheckbox('exactLookalikes')">
  312. <input type="checkbox" id="exactLookalikes" checked>
  313. <label for="exactLookalikes">Exact Look-alikes</label>
  314. </div>
  315. <div class="checkbox-item" onclick="toggleCheckbox('similarLookalikes')">
  316. <input type="checkbox" id="similarLookalikes" checked>
  317. <label for="similarLookalikes">Similar Look-alikes</label>
  318. </div>
  319. <div class="checkbox-item" onclick="toggleCheckbox('spaces')">
  320. <input type="checkbox" id="spaces" checked>
  321. <label for="spaces">Spaces & Whitespace</label>
  322. </div>
  323. <div class="checkbox-item" onclick="toggleCheckbox('dots')">
  324. <input type="checkbox" id="dots" checked>
  325. <label for="dots">Dots & Punctuation</label>
  326. </div>
  327. <div class="checkbox-item" onclick="toggleCheckbox('numbers')">
  328. <input type="checkbox" id="numbers" checked>
  329. <label for="numbers">Numbers</label>
  330. </div>
  331. <div class="checkbox-item" onclick="toggleCheckbox('accented')">
  332. <input type="checkbox" id="accented" checked>
  333. <label for="accented">Accented Letters</label>
  334. </div>
  335. </div>
  336. </div>
  337. <div>
  338. <h3>Random Mode</h3>
  339. <div class="checkbox-group">
  340. <div class="checkbox-item" onclick="toggleCheckbox('randomMode')">
  341. <input type="checkbox" id="randomMode">
  342. <label for="randomMode">Enable Random Mode</label>
  343. </div>
  344. <div class="checkbox-item" onclick="toggleCheckbox('randomTypes')">
  345. <input type="checkbox" id="randomTypes">
  346. <label for="randomTypes">Random Character Types</label>
  347. </div>
  348. <div class="checkbox-item" onclick="toggleCheckbox('randomPositions')">
  349. <input type="checkbox" id="randomPositions">
  350. <label for="randomPositions">Random Positions</label>
  351. </div>
  352. <div class="checkbox-item" onclick="toggleCheckbox('randomIntensity')">
  353. <input type="checkbox" id="randomIntensity">
  354. <label for="randomIntensity">Random Intensity</label>
  355. </div>
  356. </div>
  357. </div>
  358. </div>
  359. </div>
  360.  
  361. <div class="slider-container">
  362. <label for="intensitySlider">Obfuscation Intensity:</label>
  363. <input type="range" id="intensitySlider" class="slider" min="0" max="100" value="50">
  364. <div class="slider-value" id="intensityValue">50%</div>
  365. </div>
  366. </div>
  367.  
  368. <div class="seed-display">
  369. <strong>Current Seed:</strong> <span id="currentSeed">ABCD123456</span>
  370. <small>(Updates every 10 minutes)</small>
  371. </div>
  372.  
  373. <div class="button-group">
  374. <button class="btn-primary" onclick="obfuscateText()">🔀 Obfuscate Text</button>
  375. <button class="btn-secondary" onclick="generateNewSeed()">🎲 New Seed</button>
  376. <button class="btn-secondary" onclick="copyOutput()">📋 Copy Output</button>
  377. <button class="btn-secondary" onclick="exportCurrentAsJSON()">💾 Export JSON</button>
  378. <button class="btn-secondary" onclick="clearAll()">🗑️ Clear All</button>
  379. </div>
  380.  
  381. <div class="stats" id="stats" style="display: none;">
  382. <div class="stat-item">
  383. <div class="stat-value" id="originalLength">0</div>
  384. <div class="stat-label">Original Length</div>
  385. </div>
  386. <div class="stat-item">
  387. <div class="stat-value" id="changedChars">0</div>
  388. <div class="stat-label">Changed Characters</div>
  389. </div>
  390. <div class="stat-item">
  391. <div class="stat-value" id="changePercent">0%</div>
  392. <div class="stat-label">Actual Change %</div>
  393. </div>
  394. </div>
  395.  
  396. <div class="section">
  397. <h2>📤 Output</h2>
  398. <div class="input-group">
  399. <label for="outputText">Obfuscated text:</label>
  400. <textarea id="outputText" readonly placeholder="Your obfuscated text will appear here..."></textarea>
  401. </div>
  402. </div>
  403.  
  404. <div class="json-section">
  405. <h2>🔧 JSON API Mode</h2>
  406. <p>Use this format for programmatic access:</p>
  407. <div class="input-group">
  408. <label for="jsonInput">JSON Input:</label>
  409. <textarea id="jsonInput" class="json-input" placeholder='{"input": "Your text here", "exactLookalikes": true, "intensity": 50, "seed": "ABCD123456"}'></textarea>
  410. </div>
  411. <div class="button-group">
  412. <button class="btn-primary" onclick="processJSON()">⚡ Process JSON</button>
  413. <button class="btn-secondary" onclick="generateJSONTemplate()">📋 Generate Template</button>
  414. </div>
  415. <div class="input-group">
  416. <label for="jsonOutput">JSON Output:</label>
  417. <textarea id="jsonOutput" class="json-input" readonly placeholder="JSON output will appear here..."></textarea>
  418. </div>
  419. </div>
  420. </div>
  421. </div>
  422.  
  423. <script>
  424. // Unicode look-alike mappings
  425. const unicodeMappings = {
  426. exactLookalikes: {
  427. 'A': ['А', 'Α'], 'a': ['а', 'α'],
  428. 'B': ['В', 'Β'], 'b': ['в', 'β'],
  429. 'C': ['С'], 'c': ['с'],
  430. 'E': ['Е', 'Ε'], 'e': ['е', 'ε'],
  431. 'H': ['Н', 'Η'], 'h': ['н', 'η'],
  432. 'I': ['І', 'Ι', 'Ⅰ'], 'i': ['і', 'ι', 'ⅰ'],
  433. 'J': ['ϳ'],
  434. 'K': ['К', 'Κ'], 'k': ['к', 'κ'],
  435. 'L': ['ⅼ'],
  436. 'M': ['М', 'Μ'], 'm': ['м'],
  437. 'N': ['Ν'], 'n': ['ν'],
  438. 'O': ['О', 'Ο'], 'o': ['о', 'ο', '০', '०'],
  439. 'P': ['Р', 'Ρ'], 'p': ['р', 'ρ'],
  440. 'S': ['Ѕ'], 's': ['ѕ'],
  441. 'T': ['Т', 'Τ'], 't': ['т', 'τ'],
  442. 'U': ['Υ'], 'u': ['υ', 'µ'],
  443. 'V': ['Ѵ'], 'v': ['ѵ', 'ν'],
  444. 'X': ['Х', 'Χ'], 'x': ['х', 'χ'],
  445. 'Y': ['У'], 'y': ['у'],
  446. 'Z': ['Ζ'], 'z': ['ζ'],
  447. '0': ['O', 'О', 'Ο', '০', '०'],
  448. '1': ['l', 'I', 'І'],
  449. '2': ['Z', 'Ζ'],
  450. '5': ['S', 'Ѕ'],
  451. '6': ['б'],
  452. '7': ['Τ', 'τ']
  453. },
  454.  
  455. spaces: {
  456. ' ': ['\u00A0', '\u2000', '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', '\u2006', '\u2007', '\u2008', '\u2009', '\u200A', '\u202F', '\u205F', '\u3000']
  457. },
  458.  
  459. dots: {
  460. '.': ['·', '‧', '․', '܁', '⋅'],
  461. '-': ['‐', '‑', '‒', '–', '—', '―', '−']
  462. },
  463.  
  464. accented: {
  465. 'A': ['À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Ā', 'Ă', 'Ą', 'Ǎ'],
  466. 'a': ['à', 'á', 'â', 'ã', 'ä', 'å', 'ā', 'ă', 'ą', 'ǎ'],
  467. 'C': ['Ć', 'Ĉ', 'Ċ', 'Č', 'Ç', 'Ƈ'],
  468. 'c': ['ć', 'ĉ', 'ċ', 'č', 'ç', 'ƈ'],
  469. 'E': ['È', 'É', 'Ê', 'Ë', 'Ē', 'Ĕ', 'Ė', 'Ę', 'Ě'],
  470. 'e': ['è', 'é', 'ê', 'ë', 'ē', 'ĕ', 'ė', 'ę', 'ě'],
  471. 'I': ['Ì', 'Í', 'Î', 'Ï', 'Ĩ', 'Ī', 'Ĭ', 'Į', 'İ'],
  472. 'i': ['ì', 'í', 'î', 'ï', 'ĩ', 'ī', 'ĭ', 'į', 'ı'],
  473. 'N': ['Ñ', 'Ń', 'Ņ', 'Ň', 'Ŋ'],
  474. 'n': ['ñ', 'ń', 'ņ', 'ň', 'ŋ'],
  475. 'O': ['Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ō', 'Ŏ', 'Ő', 'Ơ'],
  476. 'o': ['ò', 'ó', 'ô', 'õ', 'ö', 'ø', 'ō', 'ŏ', 'ő', 'ơ'],
  477. 'S': ['Ś', 'Ŝ', 'Ş', 'Š', 'Ș'],
  478. 's': ['ś', 'ŝ', 'ş', 'š', 'ș'],
  479. 'U': ['Ù', 'Ú', 'Û', 'Ü', 'Ũ', 'Ū', 'Ŭ', 'Ů', 'Ű', 'Ų', 'Ư'],
  480. 'u': ['ù', 'ú', 'û', 'ü', 'ũ', 'ū', 'ŭ', 'ů', 'ű', 'ų', 'ư'],
  481. 'Y': ['Ý', 'Ŷ', 'Ÿ', 'Ȳ', 'Ẏ'],
  482. 'y': ['ý', 'ŷ', 'ÿ', 'ȳ', 'ẏ'],
  483. 'Z': ['Ź', 'Ż', 'Ž'],
  484. 'z': ['ź', 'ż', 'ž']
  485. },
  486.  
  487. similarLookalikes: {
  488. 'a': ['ª'], 'o': ['º'], 'l': ['ℓ'], 'e': ['℮'], 'h': ['ℎ', 'ℏ'],
  489. '2': ['²'], '3': ['³'], '1': ['¹'], '0': ['₀']
  490. }
  491. };
  492.  
  493. let currentSeed = generateSeed();
  494. let seedTimer;
  495.  
  496. // Initialize
  497. document.addEventListener('DOMContentLoaded', function() {
  498. updateSeedDisplay();
  499. startSeedTimer();
  500.  
  501. // Update intensity display
  502. document.getElementById('intensitySlider').addEventListener('input', function() {
  503. document.getElementById('intensityValue').textContent = this.value + '%';
  504. });
  505. });
  506.  
  507. function generateSeed() {
  508. const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  509. let result = '';
  510. for (let i = 0; i < 10; i++) {
  511. result += chars.charAt(Math.floor(Math.random() * chars.length));
  512. }
  513. return result;
  514. }
  515.  
  516. function updateSeedDisplay() {
  517. document.getElementById('currentSeed').textContent = currentSeed;
  518. }
  519.  
  520. function startSeedTimer() {
  521. clearInterval(seedTimer);
  522. seedTimer = setInterval(() => {
  523. currentSeed = generateSeed();
  524. updateSeedDisplay();
  525. }, 10 * 60 * 1000); // 10 minutes
  526. }
  527.  
  528. function generateNewSeed() {
  529. currentSeed = generateSeed();
  530. updateSeedDisplay();
  531. }
  532.  
  533. function toggleCheckbox(id) {
  534. const checkbox = document.getElementById(id);
  535. checkbox.checked = !checkbox.checked;
  536. }
  537.  
  538. function seedRandom(seed) {
  539. let hash = 0;
  540. for (let i = 0; i < seed.length; i++) {
  541. const char = seed.charCodeAt(i);
  542. hash = ((hash << 5) - hash) + char;
  543. hash = hash & hash; // Convert to 32-bit integer
  544. }
  545. return function() {
  546. hash = ((hash * 1103515245) + 12345) & 0x7fffffff;
  547. return hash / 0x7fffffff;
  548. };
  549. }
  550.  
  551. function getActiveSettings() {
  552. return {
  553. exactLookalikes: document.getElementById('exactLookalikes').checked,
  554. similarLookalikes: document.getElementById('similarLookalikes').checked,
  555. spaces: document.getElementById('spaces').checked,
  556. dots: document.getElementById('dots').checked,
  557. numbers: document.getElementById('numbers').checked,
  558. accented: document.getElementById('accented').checked,
  559. randomMode: document.getElementById('randomMode').checked,
  560. randomTypes: document.getElementById('randomTypes').checked,
  561. randomPositions: document.getElementById('randomPositions').checked,
  562. randomIntensity: document.getElementById('randomIntensity').checked,
  563. intensity: parseInt(document.getElementById('intensitySlider').value),
  564. seed: currentSeed
  565. };
  566. }
  567.  
  568. function obfuscateText(customSettings = null) {
  569. const settings = customSettings || getActiveSettings();
  570. const inputText = customSettings ? customSettings.input : document.getElementById('inputText').value;
  571.  
  572. // Force new random seed for each obfuscation if not using custom settings
  573. if (!customSettings) {
  574. settings.seed = currentSeed + Date.now(); // Add timestamp for uniqueness
  575. }
  576.  
  577. const rng = seedRandom(settings.seed);
  578.  
  579. if (!inputText) {
  580. alert('Please enter some text to obfuscate.');
  581. return;
  582. }
  583.  
  584. let result = inputText;
  585. let changedCount = 0;
  586. const originalLength = inputText.length;
  587.  
  588. // Apply random mode modifications
  589. if (settings.randomMode) {
  590. if (settings.randomTypes) {
  591. const types = ['exactLookalikes', 'similarLookalikes', 'spaces', 'dots', 'numbers', 'accented'];
  592. types.forEach(type => {
  593. settings[type] = rng() > 0.5;
  594. });
  595. }
  596.  
  597. if (settings.randomIntensity) {
  598. settings.intensity = Math.floor(rng() * 100);
  599. }
  600. }
  601.  
  602. // Build active mappings
  603. const activeMappings = {};
  604. Object.keys(unicodeMappings).forEach(category => {
  605. if (settings[category]) {
  606. Object.assign(activeMappings, unicodeMappings[category]);
  607. }
  608. });
  609.  
  610. // Apply obfuscation, THIS WAS MADE BY AA17,DM25
  611. result = result.split('').map((char, index) => {
  612. if (activeMappings[char] && rng() * 100 < settings.intensity) {
  613. const alternatives = activeMappings[char];
  614. const chosen = alternatives[Math.floor(rng() * alternatives.length)];
  615. if (chosen !== char) changedCount++;
  616. return chosen;
  617. }
  618. return char;
  619. }).join('');
  620.  
  621. // Update UI
  622. if (!customSettings) {
  623. document.getElementById('outputText').value = result;
  624. updateStats(originalLength, changedCount);
  625. }
  626.  
  627. return {
  628. input: inputText,
  629. output: result,
  630. settings: settings,
  631. stats: {
  632. originalLength: originalLength,
  633. changedCharacters: changedCount,
  634. changePercentage: originalLength > 0 ? ((changedCount / originalLength) * 100).toFixed(1) : 0
  635. }
  636. };
  637. }
  638.  
  639. function updateStats(originalLength, changedCount) {
  640. document.getElementById('originalLength').textContent = originalLength;
  641. document.getElementById('changedChars').textContent = changedCount;
  642. document.getElementById('changePercent').textContent =
  643. originalLength > 0 ? ((changedCount / originalLength) * 100).toFixed(1) + '%' : '0%';
  644. document.getElementById('stats').style.display = 'grid';
  645. }
  646.  
  647. function copyOutput() {
  648. const outputText = document.getElementById('outputText');
  649. outputText.select();
  650. document.execCommand('copy');
  651.  
  652. const button = event.target;
  653. const originalText = button.textContent;
  654. button.textContent = '✅ Copied!';
  655. button.style.background = 'linear-gradient(135deg, #00b894 0%, #00a085 100%)';
  656.  
  657. setTimeout(() => {
  658. button.textContent = originalText;
  659. button.style.background = 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)';
  660. }, 2000);
  661. }
  662.  
  663. function clearAll() {
  664. document.getElementById('inputText').value = '';
  665. document.getElementById('outputText').value = '';
  666. document.getElementById('jsonInput').value = '';
  667. document.getElementById('jsonOutput').value = '';
  668. document.getElementById('stats').style.display = 'none';
  669. }
  670.  
  671. function exportCurrentAsJSON() {
  672. const inputText = document.getElementById('inputText').value;
  673. if (!inputText) {
  674. alert('Please enter some text first.');
  675. return;
  676. }
  677.  
  678. const result = obfuscateText();
  679. if (result) {
  680. const exportData = {
  681. timestamp: new Date().toISOString(),
  682. ...result
  683. };
  684.  
  685. const dataStr = JSON.stringify(exportData, null, 2);
  686. const dataBlob = new Blob([dataStr], {type: 'application/json'});
  687.  
  688. const link = document.createElement('a');
  689. link.href = URL.createObjectURL(dataBlob);
  690. link.download = `obfuscated_text_${new Date().toISOString().split('T')[0]}.json`;
  691. link.click();
  692.  
  693. // Clean up
  694. URL.revokeObjectURL(link.href);
  695.  
  696. // Show feedback
  697. const button = event.target;
  698. const originalText = button.textContent;
  699. button.textContent = '✅ Exported!';
  700. button.style.background = 'linear-gradient(135deg, #00b894 0%, #00a085 100%)';
  701.  
  702. setTimeout(() => {
  703. button.textContent = originalText;
  704. button.style.background = 'linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%)';
  705. }, 2000);
  706. }
  707. }
  708.  
  709. function generateJSONTemplate() {
  710. const template = {
  711. input: "Your text here",
  712. exactLookalikes: true,
  713. similarLookalikes: true,
  714. spaces: true,
  715. dots: true,
  716. numbers: true,
  717. accented: true,
  718. randomMode: false,
  719. randomTypes: false,
  720. randomPositions: false,
  721. randomIntensity: false,
  722. intensity: 50,
  723. seed: currentSeed
  724. };
  725.  
  726. document.getElementById('jsonInput').value = JSON.stringify(template, null, 2);
  727. }
  728.  
  729. function processJSON() {
  730. try {
  731. const jsonInput = document.getElementById('jsonInput').value;
  732. const settings = JSON.parse(jsonInput);
  733.  
  734. if (!settings.input) {
  735. throw new Error('Input text is required');
  736. }
  737.  
  738. const result = obfuscateText(settings);
  739. document.getElementById('jsonOutput').value = JSON.stringify(result, null, 2);
  740.  
  741. } catch (error) {
  742. alert('Invalid JSON format: ' + error.message);
  743. document.getElementById('jsonOutput').value = JSON.stringify({
  744. error: error.message,
  745. timestamp: new Date().toISOString()
  746. }, null, 2);
  747. }
  748. }
  749. </script>
  750. </body>
  751. </html>
Advertisement
Add Comment
Please, Sign In to add comment