Archive of Our Own: Dark Mode

A dark mode for users without an account.

  1. // ==UserScript==
  2. // @name Archive of Our Own: Dark Mode
  3. // @version 0.11
  4. // @description A dark mode for users without an account.
  5. // @match https://archiveofourown.org/*
  6. // @match http://archiveofourown.org/*
  7. // @author Felix G. "Automalix"
  8. // @namespace https://greasyfork.org/en/users/322117
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. function addGlobalStyle(css) {
  13. var head, style;
  14. head = document.getElementsByTagName('head')[0];
  15. if (!head) {return}
  16. style = document.createElement('style');
  17. style.type = 'text/css';
  18. style.innerHTML = css;
  19. head.appendChild(style)}
  20.  
  21. addGlobalStyle('body, .listbox > .heading, .listbox .heading a:visited, .filters .expander {color:#EEE} a, a:link, a:visited:hover {color:#EEEEEE} a:visited {color:#DDDDDD}'
  22. +'a.tag {color:#EFEFEF} #modal {border:10px solid #000; background:#222} li.relationships a {background:#000}'
  23. +'#symbols-key, .account.module, .work {background-color:#222 !important;}'
  24. +'#header {background:#101010} #footer{border:none} #new_work_search, #outer, #main {background:#101010}'
  25. +'.wrapper {box-shadow: 1px 1px 5px #202020;} .work.meta.group {background: #121212; border:1px solid #111}'
  26. +'fieldset, .listbox, fieldset fieldset.listbox {background-color:#222; box-shadow: inset 1px 0 5px #202020; border: 2px solid #000000}'
  27. +'.listbox .index {background:#333; box-shadow:inset 1px 1px 3px #222}'
  28. +'.actions a, .actions a:link, .action, .action:link, .actions input, input[type="submit"], button, .current, .actions label{background-image:none; background:#666;'
  29. +'color:#FFF; border:none} #site_search {background:#000} form.verbose legend, .verbose form legend {background:#121212; border:2px solid #000; box-shadow:none}'
  30. +'#admin-banner {display:none}');