kawaiimoji

press button to convert alphabet to mini characters on caffe

当前为 2020-09-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name kawaiimoji
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description press button to convert alphabet to mini characters on caffe
  6. // @author #kawaiirz
  7. // @match http://caffe.senpai-agar.online/*/
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. var alphabets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'],
  12. minimoji = ['ᴀ','ʙ','ᴄ','ᴅ','ᴇ','ғ','ɢ','ʜ','ɪ','ᴊ','ᴋ','ʟ','ᴍ','ɴ','ᴏ','ᴘ','ǫ','ʀ','s','ᴛ','ᴜ','ᴠ','ᴡ','x','ʏ','ᴢ'];
  13.  
  14. var btn = document.body.appendChild(document.createElement('div'));
  15. btn.setAttribute("id", 'kawaiibtn');
  16. btn.innerText = 'ᴀ';
  17. btn.style.fontSize = 'small';
  18. btn.style.backgroundColor = 'whitesmoke';
  19. btn.style.cursor = 'pointer';
  20. btn.style.border = 'solid 1px black';
  21. btn.style.zIndex = 1;
  22. btn.style.position = 'absolute';
  23. btn.style.top = '30px';
  24. btn.style.right = '6px';
  25. btn.style.padding = '2px 8px 3px 7px';
  26. btn.addEventListener('click', function(){
  27. var afterStrs = [],
  28. chatBox = document.getElementById('chat_input_text_box');
  29. if (chatBox) {
  30. var chatBoxStrs = chatBox.value,
  31. beforeStrs = chatBoxStrs.split('');
  32. for (i=0; i<beforeStrs.length; i++) {
  33. for (ii=0; ii<alphabets.length; ii++) {
  34. if (beforeStrs[i] == alphabets[ii]) {
  35. afterStrs[i] = minimoji[ii];
  36. break;
  37. }
  38. }
  39. }
  40. chatBox.value = afterStrs.join('');
  41. }
  42. }, false);
  43. })();