// ==UserScript== // @name NightShift - eye care // @namespace http://userstyles.org // @description A 'darkening' style for white/bright websites - especially for browsing at low light (~in the night); // @author vetinari // @homepage https://userstyles.org/styles/18192 // @run-at document-start // @version 0.20120613103834 // ==/UserScript== (function() {var css = ""; css += [ "/* AGENT_SHEET */", "/* ▓▓ NIGHTSHIFT - eye care: ▓▓", " ▓▓ A darkening style for all websites. ▓▓", " ▓▓ by vetinari - 2009 ▓▓", " ▓▓ contact: vetinari.userstyles@inode.at ▓▓", " ▓▓ --------------------------------------- ▓▓", " ▓▓ last modified: 13.06.2012 ▓▓", " ▓▓_________________________________________▓▓ */", "", "@namespace url(http://www.w3.org/1999/xhtml);" ].join("\n"); if (false || (document.location.href.indexOf("http://") == 0) || (document.location.href.indexOf("https://") == 0) || (document.location.href.indexOf("about:blank") == 0)) css += [ "body,html {min-height: 100%!important; }", "", "html, body{background-color:#111!important}", "body>*:not(:empty){background-color:#222!important}", "body>*>*:not(:empty){background-color:#222!important}", "body>*>*>*:not(:empty){background-color:#282828!important}", "body>*>*>*>*:not(:empty){background-color:#282828!important}", "body>*>*>*>*>*:not(:empty){background-color:#383838!important}", "body>*>*>*>*>* *{background-color:#383838!important}", "body table:not(:empty){background-color:#282828!important}", "body table>tbody>tr:nth-child(even){background-color:rgba(0,0,0,.2)!important}", "body table>tbody>tr>td:nth-child(odd){background-color:rgba(0,0,0,.1)!important}", "body *:empty{background-color: #111!important}", "", "body p:not(:empty), body p *, body h1, body h1 *, body h2, body h2 *, body h3, body h3 *, body h4, body h4 *, body h5, body h5 *, body strong>*, body b>*, body em>*, body i>*, body span>*:not(img){background:transparent none!important}", "body h1, body h1 *, body h2, body h2 *, p>strong:only-of-type, p>b:only-of-type{color: #a98!important}", "body h3, body h3 *, body h4, body h4 *{color: #aaa!important}", "", "*:not([onclick]):not(input):not(a):not(img):not([class^=\"UI\"]), body a:not(:empty), div:not([onclick]){background-image:none!important; text-indent:0!important}", "*[onclick] {color:#79a!important}", "*[onclick]:hover {color:#99a8aa!important}", "body hr{background: #666 none!important; color: #666!important; border:1px solid #666!important; height: 1px!important; overflow:hidden!important; display: block!important}", "* {color: #c0c0c0!important; border-color:#60666a!important;box-shadow: 0 0 0 #333!important}", "* body a, body a *{color: #B6AA7B!important;}", "/* body a:visited, body a:visited *{color: #666!important;} */", "body a:hover, body a:hover *{color: #D9C077!important; text-decoration: underline!important}", "body img,a[href] img, a[href] button, input[type=\"image\"],*[onclick]:empty, body a:empty{opacity:.5!important}", "body img:hover,a[href]:hover img, a[href]:hover button, *[onclick]:empty:hover, body a:empty:hover{opacity:1!important}", "", "body span>img{visibility:visible!important}", "", "body input[type], input, body textarea, body select{-moz-appearance:none!important; color: #bbb!important; border-radius:4px !important; border-width: 1px!important; border-color:rgba(100,100,100,.5)!important;border-style:solid!important; background:-moz-linear-gradient( top , #303030 40%, #383838, #343434 ) #333 !important; box-shadow: inset 1px 1px 1px #111!important}", "body input[type=\"submit\"], body input[type=\"button\"], body input[type=\"image\"], body input[type=\"reset\"], body button{-moz-appearance:none!important; color: #bbb!important; border-radius:4px !important; border-width: 1px!important; border-color:rgba(100,100,100,.5)!important;border-style:solid!important; background:-moz-linear-gradient( top , #404040 45%, #282828 55%) #333 !important; box-shadow: 1px 1px 1px #111!important}", "body input[type]>*, body textarea>*{-moz-appearance:none!important; background:transparent none !important; color: #bbb!important; border-style:solid!important; border-width: 0px!important;}", "body select *{background-color:transparent !important; color: #bbb!important; border-style:solid!important; border-width: 0px!important;}", "", "pre:not(:empty), code:not(:empty) , cite:not(:empty), pre:not(:empty) *, code:not(:empty) *, cite:not(:empty) *{background-image:url(data:image/gif;base64,R0lGODlhBAAEAIAAABERESIiIiH5BAAAAAAALAAAAAAEAAQAAAIGTACXaHkFADs=)!important; color: #bcc8dc!important;}" ].join("\n"); if (typeof GM_addStyle != "undefined") { GM_addStyle(css); } else if (typeof PRO_addStyle != "undefined") { PRO_addStyle(css); } else if (typeof addStyle != "undefined") { addStyle(css); } else { var node = document.createElement("style"); node.type = "text/css"; node.appendChild(document.createTextNode(css)); var heads = document.getElementsByTagName("head"); if (heads.length > 0) { heads[0].appendChild(node); } else { // no head yet, stick it whereever document.documentElement.appendChild(node); } } })(); |