hide single problem tag on CF

hide single problem tag on Codeforces

  1. // ==UserScript==
  2. // @name hide single problem tag on CF
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description hide single problem tag on Codeforces
  6. // @author ouuan
  7. // @match https://codeforces.com/*
  8. // @match https://codeforc.es/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var cur = 0;
  16. var tags, btn, hint;
  17.  
  18. function change() {
  19. if (cur ^= 1) {
  20. tags.style.display = 'block';
  21. hint.style.display = 'none';
  22. btn.innerText = '▲';
  23. } else {
  24. hint.style.display = 'block';
  25. tags.style.display = 'none';
  26. btn.innerText = '▼';
  27. }
  28. }
  29.  
  30. var boxes = document.querySelectorAll('.roundbox.sidebox');
  31.  
  32. for (var box of boxes) {
  33. if (box.innerText.match('Problem tags')) {
  34. tags = box.children[3];
  35. tags.style.display = 'none';
  36. hint = document.createElement('span');
  37. hint.innerText = 'Tags are hidden.';
  38. hint.style.padding = '0.5em';
  39. hint.style.display = 'block';
  40. box.appendChild(hint);
  41. btn = document.createElement('span');
  42. btn.style.cursor = 'pointer';
  43. btn.innerText = '▼';
  44. btn.onclick = change;
  45. box.children[2].appendChild(btn);
  46. }
  47. }
  48. })();

QingJ © 2025

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