Parallel Realities: Tutorial Readability

Make the tutorials more readable

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