Guest User

Untitled

a guest
Aug 22nd, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Avatar Preview - canto inferior esquerdo (clean + arredondado)
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Mostra a foto de avatar no canto inferior esquerdo (grande, sem borda branca, mas arredondado)
  6. // @match http://localhost:3000/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. function showAvatar() {
  14. let avatarImg = document.querySelector('img[data-scope="avatar"]');
  15. if (!avatarImg) return;
  16.  
  17. let preview = document.getElementById("tm-avatar-preview");
  18.  
  19. if (!preview) {
  20. preview = document.createElement("img");
  21. preview.id = "tm-avatar-preview";
  22. Object.assign(preview.style, {
  23. position: "fixed",
  24. bottom: "10px",
  25. left: "10px",
  26. width: "470px", // aumentado 2,2x
  27. height: "auto",
  28. border: "none", // sem borda
  29. borderRadius: "15px", // arredondado bonito
  30. zIndex: "99999",
  31. background: "transparent",
  32. padding: "0",
  33. boxShadow: "none"
  34. });
  35. document.body.appendChild(preview);
  36. }
  37.  
  38. // só atualiza se mudar
  39. if (preview.src !== avatarImg.src) {
  40. preview.src = avatarImg.src;
  41. }
  42. }
  43.  
  44. // tenta logo no load
  45. window.addEventListener('load', showAvatar);
  46.  
  47. // observa mudanças
  48. const observer = new MutationObserver(() => {
  49. showAvatar();
  50. });
  51. observer.observe(document.body, { childList: true, subtree: true });
  52.  
  53. })();
Advertisement
Add Comment
Please, Sign In to add comment