Advertisement
AHOHNMYC

PANDEMONIUM

Apr 8th, 2020 (edited)
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         PANDEMONIUM
  3. // @namespace    REGNAT
  4. // @description  SATANI
  5. // @version      VITAE !
  6. // @include      https://anon.fm/feedback*
  7. // @include      https://alcxemuct.accountant/feedback*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. document.body.style.background = '#eee';
  12.  
  13. const i = document.getElementsByTagName`img`[0];
  14. const ca = document.createElement`canvas`;
  15. [ca.width, ca.height] = [164, 62];
  16. const c = ca.getContext`2d`;
  17. i.addEventListener('load', onCaptchaLoaded);
  18.  
  19. i.style.backgroundColor = '#fff';
  20.  
  21. function onCaptchaLoaded() {
  22.     drawShiftedImage(i);
  23. }
  24.  
  25. function drawShiftedImage(image, xMaxShift = ca.width, yMaxShift = ca.height, clean = false) {
  26.     const rx = Math.random()*xMaxShift -(200-ca.width) |0;
  27.     const ry = Math.random()*yMaxShift -(70-ca.height) |0;
  28.     const mrx = -ca.width +rx;
  29.     const mry = -ca.height+ry;
  30.     console.log(mrx, mry)
  31.     if (clean)
  32.         c.clearRect(0, 0, ca.width, ca.height)
  33.     c.drawImage(image, rx, ry);
  34.     c.drawImage(image, mrx, ry);
  35.     c.drawImage(image, rx, mry);
  36.     c.drawImage(image, mrx, mry);
  37.     document.body.style.backgroundImage = `url(${ca.toDataURL()})`
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement