Загрузка...

Заменитель символов с интерфейсом 0_0

Тема в разделе Node.js создана пользователем marmok1932 1 янв 2023. 258 просмотров

  1. marmok1932
    marmok1932 Автор темы 1 янв 2023 Заблокирован(а) 8 23 янв 2022
    Код
    <html>
    <head>
    <script >
    document.addEventListener("DOMContentLoaded", function() {

    var input = document.createElement('input');
    input.type = 'text';
    input.id = 'input';
    document.body.appendChild(input);

    input.placeholder = 'Ваш текст';

    var input2 = document.createElement('input');
    input2.type = 'text';
    input2.id = 'input2';
    document.body.appendChild(input2);
    input2.placeholder = 'Какие символы заменить';

    var input3 = document.createElement('input');
    input3.type = 'text';
    input3.id = 'input3';
    document.body.appendChild(input3);
    input3.placeholder = 'На какие символы заменить';

    var button = document.createElement('button');
    button.innerHTML = 'Начать';
    document.body.appendChild(button);

    button.onclick = function() {
    var text = document.getElementById('input').value;
    var text2 = document.getElementById('input2').value;
    var text3 = document.getElementById('input3').value;
    var result = text.replace(text2, text3);
    alert(result);
    }

    button.onclick = function() {
    var text = document.getElementById('input').value;
    var text2 = document.getElementById('input2').value;
    var text3 = document.getElementById('input3').value;
    var result = text.replace(new RegExp(text2, 'g'), text3);
    alert(result);
    }

    button.style.width = '100px';
    button.style.height = '50px';
    button.style.fontSize = '20px';
    button.style.backgroundColor = '#00ff00';
    button.style.borderRadius = '10px';
    button.style.border = '1px solid black';
    button.style.margin = '10px';

    input.style.width = '300px';
    input.style.height = '50px';
    input.style.fontSize = '20px';
    input.style.backgroundColor = '#00ff00';
    input.style.borderRadius = '10px';
    input.style.border = '1px solid black';
    input.style.margin = '10px';

    input2.style.width = '300px';
    input2.style.height = '50px';
    input2.style.fontSize = '20px';
    input2.style.backgroundColor = '#00ff00';
    input2.style.borderRadius = '10px';
    input2.style.border = '1px solid black';
    input2.style.margin = '10px';

    input3.style.width = '300px';
    input3.style.height = '50px';
    input3.style.fontSize = '20px';
    input3.style.backgroundColor = '#00ff00';
    input3.style.borderRadius = '10px';
    input3.style.border = '1px solid black';
    input3.style.margin = '10px';

    input.style.backgroundColor = '#ffffff';
    input2.style.backgroundColor = '#ffffff';
    input3.style.backgroundColor = '#ffffff';

    button.onclick = function() {
    var text = document.getElementById('input').value;
    var text2 = document.getElementById('input2').value;
    var text3 = document.getElementById('input3').value;
    var result = text.replace(new RegExp(text2, 'g'), text3);
    alert(result);
    button.style.backgroundColor = '#ff0000';
    setTimeout(function() {
    button.style.backgroundColor = '#00ff00';
    }, 500);
    }

    var select = document.createElement('select');
    select.id = 'select';
    document.body.appendChild(select);

    var option1 = document.createElement('option');
    option1.innerHTML = 'Русский';
    option1.value = 'ru';
    select.appendChild(option1);

    var option2 = document.createElement('option');
    option2.innerHTML = 'English';
    option2.value = 'en';
    select.appendChild(option2);

    select.onchange = function() {
    if (select.value == 'en') {
    input.placeholder = 'Your text';
    input2.placeholder = 'What characters to replace';
    input3.placeholder = 'On what characters to replace';
    button.innerHTML = 'Start';
    } else {
    input.placeholder = 'Ваш текст';
    input2.placeholder = 'Какие символы заменить';
    input3.placeholder = 'На какие символы заменить';
    button.innerHTML = 'Начать';
    }
    }

    var option3 = document.createElement('option');
    option3.innerHTML = 'Deutsch';
    option3.value = 'de';
    select.appendChild(option3);

    var option4 = document.createElement('option');
    option4.innerHTML = 'Українська';
    option4.value = 'ua';
    select.appendChild(option4);

    var option5 = document.createElement('option');
    option5.innerHTML = '中文';
    option5.value = 'zh';
    select.appendChild(option5);

    var option6 = document.createElement('option');
    option6.innerHTML = 'Português';
    option6.value = 'pt';
    select.appendChild(option6);

    select.onchange = function() {
    if (select.value == 'en') {
    input.placeholder = 'Your text';
    input2.placeholder = 'What characters to replace';
    input3.placeholder = 'On what characters to replace';
    button.innerHTML = 'Start';
    } else if (select.value == 'de') {
    input.placeholder = 'Ihr Text';
    input2.placeholder = 'Welche Zeichen zu ersetzen';
    input3.placeholder = 'Auf welche Zeichen zu ersetzen';
    button.innerHTML = 'Anfang';
    } else if (select.value == 'ua') {
    input.placeholder = 'Ваш текст';
    input2.placeholder = 'Які символи замінити';
    input3.placeholder = 'На які символи замінити';
    button.innerHTML = 'Початок';
    } else if (select.value == 'zh') {
    input.placeholder = '您的文字';
    input2.placeholder = '要替换的字符';
    input3.placeholder = '替换为什么字符';
    button.innerHTML = '开始';
    } else if (select.value == 'pt') {
    input.placeholder = 'Seu texto';
    input2.placeholder = 'Que caracteres para substituir';
    input3.placeholder = 'Em que caracteres para substituir';
    button.innerHTML = 'Começar';
    } else {
    input.placeholder = 'Ваш текст';
    input2.placeholder = 'Какие символы заменить';
    input3.placeholder = 'На какие символы заменить';
    button.innerHTML = 'Начать';
    }
    }

    select.style.width = '100px';
    select.style.height = '50px';
    select.style.fontSize = '20px';
    select.style.backgroundColor = '#00ff00';
    select.style.borderRadius = '10px';
    select.style.border = '1px solid black';
    select.style.margin = '10px';

    select.style.backgroundColor = '#ffffff';

    input.style.display = 'block';
    input2.style.display = 'block';
    input3.style.display = 'block';
    button.style.display = 'block';
    select.style.display = 'block';

    input.style.margin = '15px';
    input2.style.margin = '15px';
    input3.style.margin = '15px';
    button.style.margin = '15px';
    select.style.margin = '15px';

    input.style.margin = '15px 0';
    input2.style.margin = '15px 0';
    input3.style.margin = '15px 0';
    button.style.margin = '15px 0';
    select.style.margin = '15px 0';
    });
    </script>
    </head>
    <body style="margin: 0;">
    <div style="background-color: black; position: fixed; bottom: 0; width: 100%; height: 20px; padding: 20px; opacity: .85; z-index: 1000;">
    <svg id="Layer_1" data-name="Layer 1" height="40px" width="40px" style="top: -8px;
    position: relative;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><defs><style>.cls-1{fill:#fff;}</style></defs><title>openai-symbol-flat-white</title><path class="cls-1" d="M617.24,354a126.36,126.36,0,0,0-10.86-103.79,127.8,127.8,0,0,0-137.65-61.32,126.36,126.36,0,0,0-95.31-42.49A127.81,127.81,0,0,0,251.5,234.89,126.4,126.4,0,0,0,167,296.19a127.82,127.82,0,0,0,15.72,149.86,126.36,126.36,0,0,0,10.86,103.79,127.81,127.81,0,0,0,137.65,61.32,126.36,126.36,0,0,0,95.31,42.49A127.81,127.81,0,0,0,548.5,565.11,126.4,126.4,0,0,0,633,503.81,127.82,127.82,0,0,0,617.24,354ZM426.58,620.49a94.79,94.79,0,0,1-60.85-22c.77-.42,2.12-1.16,3-1.7l101-58.34a16.42,16.42,0,0,0,8.3-14.37V381.69l42.69,24.65a1.52,1.52,0,0,1,.83,1.17V525.43A95.18,95.18,0,0,1,426.58,620.49ZM222.34,533.26A94.74,94.74,0,0,1,211,469.56c.75.45,2.06,1.25,3,1.79l101,58.34a16.44,16.44,0,0,0,16.59,0l123.31-71.2v49.3a1.53,1.53,0,0,1-.61,1.31L352.19,568.05A95.16,95.16,0,0,1,222.34,533.26ZM195.77,312.77a94.71,94.71,0,0,1,49.48-41.68c0,.87-.05,2.41-.05,3.48V391.25a16.41,16.41,0,0,0,8.29,14.36L376.8,476.8l-42.69,24.65a1.53,1.53,0,0,1-1.44.13l-102.11-59A95.16,95.16,0,0,1,195.77,312.77Zm350.74,81.62L423.2,323.19l42.69-24.64a1.53,1.53,0,0,1,1.44-.13l102.11,58.95a95.08,95.08,0,0,1-14.69,171.55c0-.88,0-2.42,0-3.49V408.75A16.4,16.4,0,0,0,546.51,394.39ZM589,330.44c-.75-.46-2.06-1.25-3-1.79L485,270.31a16.46,16.46,0,0,0-16.59,0l-123.31,71.2v-49.3a1.53,1.53,0,0,1,.61-1.31L447.81,232A95.07,95.07,0,0,1,589,330.44ZM321.89,418.31l-42.7-24.65a1.52,1.52,0,0,1-.83-1.17V274.57a95.07,95.07,0,0,1,155.9-73c-.77.42-2.11,1.16-3,1.7l-101,58.34a16.41,16.41,0,0,0-8.3,14.36Zm23.19-50L400,336.59l54.92,31.7v63.42L400,463.41l-54.92-31.7Z"/></svg>
    <div style="display: inline-block; color: white; vertical-align: top; margin-top: 4px; font-family: Helvetica, sans-serif;">

    </div>
    </div>
    </body>
    </html>
     
    1 янв 2023 Изменено
  2. бибизьян
    Сделай чтобы рандомно было. Типо текст вставляешь и оно само там берет рандомные символы и заменяет на похожие английские в рандомные местах, а так норм :newyear1:
     
    1. marmok1932 Автор темы
      бибизьян, я запарился больше всего на перевод (15 языков целых)
    2. бибизьян
      marmok1932, зачем? Русский и английский и готово :newyear1:
    3. marmok1932 Автор темы
      бибизьян, вдруг татар будет пользоваться:crazy:
  3. актив
    актив 1 янв 2023 Заблокирован(а)
    годно
     
    1. актив
      для антиплагиата
  4. MirucatPlay
    MirucatPlay 2 янв 2023 9 17 мар 2021
    глаза плывут когда вары вижу(
     
    1. kom1ssar666
      MirucatPlay, я думал мне одному стало плохо, как будто кто то легаси деда вытащил
    2. MirucatPlay
      kom1ssar666, мужик с 2014 в бункере сидел
Загрузка...
Top