AtCoder Better Font

Make fonts on AtCoder more readable

2023-04-17 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

  1. // ==UserScript==
  2. // @name AtCoder Better Font
  3. // @name:ja AtCoder Better Font
  4. // @namespace https://github.com/xe-o
  5. // @version 0.1
  6. // @description Make fonts on AtCoder more readable
  7. // @description:ja AtCoderのフォントをより見やすくします
  8. // @author XERO
  9. // @license MIT
  10. // @match https://atcoder.jp/*
  11. // @run-at document-start
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. "use strict";
  17.  
  18. const css = `
  19. body, p, a, h3, h4, h5, .h3, .h4, .h5 {
  20. font-family: 'Noto Sans JP', "Helvetica Neue", arial, sans-serif;
  21. }
  22. h2, .h2 {
  23. font-family: 'Lato', "Helvetica Neue", arial, sans-serif;
  24. }
  25. .base {
  26. font: bold 1.1em KaTeX_Main,Times New Roman, serif;
  27. }
  28. code, kbd, pre, samp {
  29. font-family: Menlo, Monaco, Consolas, Noto Sans JP, "Courier New", monospace;
  30. }
  31. code {
  32. color: #d53434;
  33. background-color: #f1efef;
  34. }
  35. #task-statement code {
  36. font-size: 1.2em !important;
  37. }
  38. `;
  39.  
  40. const styleNode = document.createTextNode(css);
  41. document.head.insertAdjacentHTML("beforeend", "<style></style>");
  42. document.head.lastElementChild.appendChild(styleNode);
  43. })();