[GC] Visualizer for Shop Ban

Displays your current shop ban status in visual format directly on the page.

  1. // ==UserScript==
  2. // @name [GC] Visualizer for Shop Ban
  3. // @namespace https://gf.qytechs.cn/en/users/1225524-kaitlin
  4. // @match https://www.grundos.cafe/viewshop/*
  5. // @grant GM.addStyle
  6. // @license MIT
  7. // @version 1.0
  8. // @author Cupkait
  9. // @icon https://i.imgur.com/4Hm2e6z.png
  10. // @description Displays your current shop ban status in visual format directly on the page.
  11. // Next up: Settings! Probably always on, always off, alert only (and set what % you want it to appear at).
  12. // ==/UserScript==
  13.  
  14.  
  15. var shopBan = $('.big-image').attr('title').match(/\d+/g); // Grab current ban amount from image title.
  16. var barColor = getBarColor(shopBan); // Determine color of bar based on how close you are to a ban.
  17. setprogressGradient(barColor);
  18.  
  19. $('#greeting').remove();
  20. $('.nomargin').eq(0).remove();
  21. $('.nomargin').eq(0).append(`<div class="range" style="--p:${shopBan}"></div>`);
  22. $('#page_footer').remove();
  23.  
  24. function getBarColor(shopBan) {
  25. // This range of colors is kinda ugly in the middle right now
  26. // but I'll worry about that later.
  27. var colors = ['#70fa77', '#7ff166', '#8ce855', '#97df45', '#a0d535', '#a9cc26', '#b0c215', '#b7b800', '#bdae00', '#c2a400', '#c69a00', '#c98f00', '#cc8400', '#ce7a01', '#cf6f0e', '#cf6318', '#ce5820', '#cd4c27', '#ca402d', '#c73333'];
  28. var colorIndex = Math.floor(shopBan / 5);
  29. return colors[colorIndex];
  30. }
  31.  
  32.  
  33. // CSS required for the bar to appear correctly.
  34. async function setprogressGradient(barColor) {
  35. GM.addStyle(`.range {
  36. position: relative;
  37. background-color: #33333338;
  38. width: 100%;
  39. height: 15px;
  40. margin-top: 5px;
  41. transform: skew(30deg);
  42. font-family: 'Courier', monospace;
  43. }
  44.  
  45. .range:before {
  46. --width: calc(var(--p) * 1%);
  47. content: '';
  48. position: absolute;
  49. top: 0;
  50. left: 0;
  51. width: 0;
  52. height: 100%;
  53. background-color: ${barColor};
  54. z-index: 0;
  55. animation: load 2.5s forwards linear(0 0%, 0 2.27%, 0.02 4.53%, 0.04 6.8%, 0.06 9.07%, 0.1 11.33%, 0.14 13.6%, 0.25 18.15%, 0.39 22.7%, 0.56 27.25%, 0.77 31.8%, 1 36.35%, 0.89 40.9%, 0.85 43.18%, 0.81 45.45%, 0.79 47.72%, 0.77 50%, 0.75 52.27%, 0.75 54.55%, 0.75 56.82%, 0.77 59.1%, 0.79 61.38%, 0.81 63.65%, 0.85 65.93%, 0.89 68.2%, 1 72.7%, 0.97 74.98%, 0.95 77.25%, 0.94 79.53%, 0.94 81.8%, 0.94 84.08%, 0.95 86.35%, 0.97 88.63%, 1 90.9%, 0.99 93.18%, 0.98 95.45%, 0.99 97.73%, 1 100%); }
  56.  
  57. .range:after {
  58. counter-reset: progress var(--p);
  59. content: counter(progress) '% to shop ban';
  60. color: #000;
  61. position: absolute;
  62. right: 5%;
  63. top: 50%;
  64. transform: translateY(-50%) skewX(-30deg);
  65. z-index: 1;
  66. }
  67. h1.greeting {
  68. font-family:heffaklump;
  69. font-size:22px;
  70. font-weight:normal;
  71. }
  72. @keyframes load {
  73. to {
  74. width: var(--width);
  75. }
  76. }`);
  77. }

QingJ © 2025

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