Parallel Realities: Tutorial Readability

Make the tutorials more readable

当前为 2022-08-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Parallel Realities: Tutorial Readability
  3. // @namespace http://codesthings.com
  4. // @version 1.2
  5. // @description Make the tutorials more readable
  6. // @author JamesCodesThings
  7. // @license MIT
  8. // @match *://*.parallelrealities.co.uk/tutorials/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=parallelrealities.co.uk
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const readableCss = `
  17. @font-face {
  18. font-family: 'DejaVu Sans';
  19. font-style: normal;
  20. font-weight: 400;
  21. src: local('DejaVu Sans'), url('https://fonts.cdnfonts.com/s/107/DejaVuSans.woff') format('woff');
  22. }
  23. @font-face {
  24. font-family: 'DejaVu Sans';
  25. font-style: italic;
  26. font-weight: 400;
  27. src: local('DejaVu Sans'), url('https://fonts.cdnfonts.com/s/107/DejaVuSans-Oblique.woff') format('woff');
  28. }
  29. @font-face {
  30. font-family: 'DejaVu Sans';
  31. font-style: normal;
  32. font-weight: 700;
  33. src: local('DejaVu Sans'), url('https://fonts.cdnfonts.com/s/107/DejaVuSans-Bold.woff') format('woff');
  34. }
  35. @font-face {
  36. font-family: 'DejaVu Sans';
  37. font-style: italic;
  38. font-weight: 700;
  39. src: local('DejaVu Sans'), url('https://fonts.cdnfonts.com/s/107/DejaVuSans-BoldOblique.woff') format('woff');
  40. }
  41. @font-face {
  42. font-family: 'DejaVu Sans Condensed';
  43. font-style: normal;
  44. font-weight: 400;
  45. src: local('DejaVu Sans Condensed'), url('https://fonts.cdnfonts.com/s/107/DejaVuSansCondensed.woff') format('woff');
  46. }
  47. @font-face {
  48. font-family: 'DejaVu Sans Condensed';
  49. font-style: italic;
  50. font-weight: 400;
  51. src: local('DejaVu Sans Condensed'), url('https://fonts.cdnfonts.com/s/107/DejaVuSansCondensed-Oblique.woff') format('woff');
  52. }
  53. @font-face {
  54. font-family: 'DejaVu Sans Condensed';
  55. font-style: normal;
  56. font-weight: 700;
  57. src: local('DejaVu Sans Condensed'), url('https://fonts.cdnfonts.com/s/107/DejaVuSansCondensed-Bold.woff') format('woff');
  58. }
  59. @font-face {
  60. font-family: 'DejaVu Sans Condensed';
  61. font-style: italic;
  62. font-weight: 700;
  63. src: local('DejaVu Sans Condensed'), url('https://fonts.cdnfonts.com/s/107/DejaVuSansCondensed-BoldOblique.woff') format('woff');
  64. }
  65.  
  66.  
  67. @font-face {
  68. font-family: 'DejaVu Sans Mono';
  69. font-style: normal;
  70. font-weight: 400;
  71. src: local('DejaVu Sans Mono'), url('https://fonts.cdnfonts.com/s/108/DejaVuSansMono.woff') format('woff');
  72. }
  73. @font-face {
  74. font-family: 'DejaVu Sans Mono';
  75. font-style: italic;
  76. font-weight: 400;
  77. src: local('DejaVu Sans Mono'), url('https://fonts.cdnfonts.com/s/108/DejaVuSansMono-Oblique.woff') format('woff');
  78. }
  79. @font-face {
  80. font-family: 'DejaVu Sans Mono';
  81. font-style: normal;
  82. font-weight: 700;
  83. src: local('DejaVu Sans Mono'), url('https://fonts.cdnfonts.com/s/108/DejaVuSansMono-Bold.woff') format('woff');
  84. }
  85. @font-face {
  86. font-family: 'DejaVu Sans Mono';
  87. font-style: italic;
  88. font-weight: 700;
  89. src: local('DejaVu Sans Mono'), url('https://fonts.cdnfonts.com/s/108/DejaVuSansMono-BoldOblique.woff') format('woff');
  90. }
  91.  
  92. body.readable {
  93. background:none;
  94. background-color: #1a1a1a;
  95. font-family: 'DejaVu Sans', sans-serif;
  96. font-size: 14px;
  97. }
  98.  
  99. .readable code.hljs {
  100. border: solid 1px #2e2e2e;
  101. font-family : 'DejaVu Sans Mono' , sans-serif ;
  102. font-size: 1rem;
  103. }
  104.  
  105. .readable span.code {
  106. font-family : 'DejaVu Sans Mono' , sans-serif ;
  107. }
  108.  
  109. .readable p.subSection {
  110. border-bottom: none;
  111. font-size: 18px;
  112. }
  113.  
  114. .readable a.backToTOC, iframe.itchio {
  115. display:none;
  116. }`;
  117.  
  118. document.body.className += 'readable';
  119. GM_addStyle(readableCss);
  120. })();