🏠 Home 

Ревёрс текста

Реверсирование текста без смещения букв


Install this script?
  1. // ==UserScript==
  2. // @name Ревёрс текста
  3. // @name Реверс текста
  4. // @namespace http://tampermonkey.net/
  5. // @version 185.0
  6. // @description Реверсирование текста без смещения букв
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. // Функция для реверсирования текста
  13. function reversedText(text) {
  14. return text.split('').reverse().join('');
  15. }
  16. // Создаем интерфейс для ввода текста
  17. let inputContainer = document.createElement('div');
  18. inputContainer.style.position = 'fixed';
  19. inputContainer.style.bottom = '10px';
  20. inputContainer.style.right = '10px';
  21. inputContainer.style.background = '#fff';
  22. inputContainer.style.border = '1px solid #000';
  23. inputContainer.style.padding = '10px';
  24. inputContainer.style.zIndex = 10000;
  25. // Поле для ввода текста
  26. let inputField = document.createElement('textarea');
  27. inputField.maxLength = 10000;
  28. inputField.rows = 2;
  29. inputField.cols = 30;
  30. // Кнопка для реверсирования текста
  31. const reverseBtn = document.createElement('button');
  32. reverseBtn.textContent = 'Реверсировать';
  33. reverseBtn.onclick = () => {
  34. const input = inputField.value;
  35. if (input) {
  36. const reversed = reversedText(input);
  37. navigator.clipboard.writeText(reversed);
  38. alert(`Реверсированный текст: ${reversed}`);
  39. }
  40. };
  41. inputContainer.appendChild(inputField);
  42. inputContainer.appendChild(reverseBtn);
  43. document.body.appendChild(inputContainer);
  44. })();
  45. // @namespace http://tampermonkey.net/
  46. // @version 2024-11-23
  47. // @description try to take over the world!
  48. // @author You
  49. // @match http://*/*
  50. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  51. // @grant none
  52. // ==/UserScript==
  53. (function() {
  54. 'use strict';
  55. // Your code here...
  56. })();