Spectrum Tweaks

Editing the styling of the Spectrum website for better aesthetics and legibility

目前為 2017-02-20 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Spectrum Tweaks
  3. // @namespace https://robertsspaceindustries.com/spectrum/*
  4. // @version 0.1
  5. // @description Editing the styling of the Spectrum website for better aesthetics and legibility
  6. // @author Royalkin
  7. // @match https://robertsspaceindustries.com/spectrum/community/SC/forum/*
  8. // @grant
  9. // ==/UserScript==
  10.  
  11. function addGlobalStyle(css) {
  12. var head, style;
  13. head = document.getElementsByTagName('head')[0];
  14. if (!head) { return; }
  15. style = document.createElement('style');
  16. style.type = 'text/css';
  17. style.innerHTML = css;
  18. head.appendChild(style);
  19. }
  20.  
  21. //-----------------------------------------------------
  22. // DON'T EDIT THIS IF YOU DON'T KNOW WHAT YOU'RE DOING!
  23. //-----------------------------------------------------
  24.  
  25. // Changes Background Image and Color
  26. addGlobalStyle('.theme-dark#app { background: #0b111a url("https://robertsspaceindustries.com/rsi/static/images/common/bg-stars-1280.jpg"); !important; ');
  27.  
  28. //Increases the Spacing between Thread Rows
  29. addGlobalStyle('#page.forum-channel .threads-list .row { padding: 25px 10px 25px 20px; !important; }');
  30.  
  31. //Increases the Size of Thread Title
  32. addGlobalStyle('#page.forum-channel .threads-list .row .column.subject .subject-content a.thread-subject { font-size: 1.0rem; !important; }');
  33.  
  34. //Increases the spacing between the post text and bottom (quote, etc.) buttons
  35. addGlobalStyle('.forum-thread-item > .content .content-footer { padding-top: 10rem !important; }');
  36.  
  37. //Increases the spacing between the post author and post text
  38. addGlobalStyle('.forum-thread-item > .content .content-header { padding-bottom: 2rem !important; }');
  39.  
  40. //Limits the width of the site to 80% of the browser
  41. addGlobalStyle('#app #app-content { margin: auto; width: 80%; !important; }');
  42.  
  43. //Limits the width of the site header to 80% of the browser
  44. addGlobalStyle('#app-header { margin: auto; width: 80%; !important; }');
  45.  
  46. //Adds a border to the left side of the sidebar
  47. addGlobalStyle('#sidebar { border-left: 1px solid #405171; !important }');
  48.  
  49. //Ensures proper location of RSI button (top left corner)
  50. addGlobalStyle('#app #app-header a.logo {left: 10%; !important }');
  51.  
  52. //Changes thread titles to a brighter color
  53. addGlobalStyle('.theme-dark #page.forum-channel .threads-list .row .column.subject .subject-content a.thread-subject { color: #D6E3EB; !important }');