Avatar Builder+ Alternative

you can change your avatar/pfp to any image (animated images are not working)

目前為 2022-04-05 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Avatar Builder+ Alternative
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description you can change your avatar/pfp to any image (animated images are not working)
  6. // @author Vholran
  7. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
  8. // @match https://*.drawaria.online/avatar/builder/
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function ($, undefined) {
  14. $(function () {
  15.  
  16. let wait;
  17. Start();
  18.  
  19. function Start(){
  20. wait = setInterval(function(){
  21. if($('.Canvas').length === 1){
  22. AvatarAlt();
  23. }
  24. }, 200);
  25. }
  26.  
  27. function AvatarAlt(){
  28. clearInterval(wait);
  29. $('header').append('<label class="Button" for="image_input">Upload Image</label><input style="display:none" id="image_input" type="file" accept="accept="image/*">');
  30.  
  31. let uploaded_image;
  32. $("#image_input").change(function() {
  33. const reader = new FileReader();
  34.  
  35. reader.addEventListener('load', function (){
  36. uploaded_image = reader.result;
  37. ChangeAvatar(uploaded_image);
  38.  
  39. });
  40. reader.readAsDataURL(this.files[0]);
  41.  
  42. });
  43.  
  44. }
  45. function ChangeAvatar(imageData) {
  46. var canvas=document.getElementsByClassName("main")[0];
  47. var ctx=canvas.getContext("2d");
  48. var img=new Image();
  49. img.onload = function(){
  50. ctx.clearRect(0, 0, canvas.width, canvas.height);
  51. ctx.drawImage(img,0,0,canvas.width,canvas.width);
  52. };
  53. img.src=imageData;
  54. }
  55.  
  56. });
  57.  
  58. })(window.jQuery.noConflict(true));

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址