V2EX 😆

Replace ❤️ with 😆 in v2ex

  1. // ==UserScript==
  2. // @name V2EX 😆
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Replace ❤️ with 😆 in v2ex
  6. // @author iyeatse
  7. // @license WTFPL
  8. // @match https://*.v2ex.com/t/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=v2ex.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. const style = document.createElement('style');
  16. style.type = 'text/css';
  17. style.innerHTML = `
  18. /* Tooltip container */
  19. .tooltip {
  20. position: relative;
  21. display: inline-block;
  22. }
  23.  
  24. /* Tooltip text */
  25. .tooltip .tooltiptext {
  26. visibility: hidden;
  27. width: 40px;
  28. background-color: black;
  29. color: #fff;
  30. text-align: center;
  31. padding: 5px 0;
  32. border-radius: 6px;
  33.  
  34. /* Position the tooltip text - see examples below! */
  35. position: absolute;
  36. z-index: 1;
  37. }
  38.  
  39. /* Show the tooltip text when you mouse over the tooltip container */
  40. .tooltip:hover .tooltiptext {
  41. visibility: visible;
  42. }
  43. `;
  44. document.getElementsByTagName('head')[0].appendChild(style);
  45.  
  46. const likes = document.querySelectorAll('#Main .box .cell .small.fade');
  47. for (const like of likes) {
  48. const emoji = document.createElement('div');
  49. emoji.className = 'tooltip';
  50. emoji.innerHTML = '😆';
  51.  
  52. const toolTip = document.createElement('span');
  53. toolTip.className = 'tooltiptext';
  54. toolTip.innerHTML = '+' + like.innerText.trim();
  55.  
  56. emoji.appendChild(toolTip);
  57. like.parentNode.replaceChild(emoji, like);
  58. }
  59. })();

QingJ © 2025

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