Post Reply 
Nocturnal Surfing
Sep. 04, 2008, 02:54 AM
Post: #1
Nocturnal Surfing
I do a lot of surfing at night, and all the bright white backgrounds and images hurt my eyes, so I've decided to write a pretty simple filter to turn the background colors to black, text to a "light" grey, links to a faded blue, remove background-images, and set the opacity of all images to 35% Smile! I didn't do a lot of testing yet with this filter, but let me know what you think of it!

Code:
[Patterns]
Name = "Nocturnal"
Active = TRUE
Multi = TRUE
URL = "($TYPE(htm)|$TYPE(css))"
Limit = 128
Match = "$TYPE(htm)((?)\0(^$TST(topmatched=1))$SET(topmatched=1)|(^*?)$STOP())$SET(1=<style type="text/css">"
        "* { background-color: #000 !important; color: #ccc !important; background-image: none !important; background: #000 !important; border: none !important; font-size: 12px !important; font-family: "Segoe UI" !important;}"
        "select, input, textarea { border: 1px solid #7489ff !important; }"
        "select:hover, input:hover, textarea:hover { border: 1px solid #1689ff !important; }"
        "a { color: #7489ff !important; text-decoration: none !important; }"
        "a:hover { color: #1689ff !important; text-decoration: underline !Important; }"
        "img { filter:alpha(opacity=35) !important; -moz-opacity:0.35 !important;opacity:0.35 !important; }"
        "</style>\0)"
        "|$TYPE(css)background(-(color|image)|) : ([a-z]|#)\9$SET(1=foo: \9)"
Replace = "\1"
Visit this user's website
Add Thank You Quote this message in a reply
Sep. 04, 2008, 05:31 AM
Post: #2
RE: Nocturnal Surfing
The problem I had with setting up your own colours for web pages was that you miss out on colour-coded text. That was why I allowed sites to set their own colours, but filtered the lightest background colours and changed them to light shades of colour of my choosing instead. The filters do not kick in if the background is dark or medium in shade. I am still happy with the background colour filters I wrote a few years ago. With Mac OS, though, I had to resort to an extension for Firefox called "Kill Bright Backgrounds", and bookmarklets for Safari.
Add Thank You Quote this message in a reply
Sep. 04, 2008, 12:11 PM
Post: #3
RE: Nocturnal Surfing
Mmmm Interesting!! Adding to my config Big Teeth
I also use to surf at night and that's what i do:

First, i put google in white and reduce the brightness of the monitor.
Second, put the light backgrounds darker, and the dark backgrounds lighter with following filter (It still needs some work):
Code:
Name = "WIP<body|styles> Reduce luminic range [LN] 080820"
Active = TRUE
URL = "$TYPE(htm)|$TYPE(css)"
Bounds = "<body*>|body$NEST({,})"
Limit = 256
Match = "(*(bgcolor=|background:))\1"
        "("
        "(#[0-2]?[0-2]?[0-2]?|black)"
        "$SET(\3=#282828)"
        "|"
        "(#[EF]?[EF]?[EF]?|white|#fff)"
        "$SET(\3=#DBDBDB)"
        ") \2"
Replace = "\1"
          "\3 "
          "\2"

Third, i use Stylish for Firefox with its autoupdates for CSS files for Google, Youtube, Yahoo and generic "Easy on the eyes"
Add Thank You Quote this message in a reply
Sep. 04, 2008, 12:32 PM
Post: #4
RE: Nocturnal Surfing
i haven't used the feature in a while, but did you know that filters can be written to only activate themselves between the hours of 10pm and 6am (or any time you preselect, i used to use it so that some filters would not function during "office hours")...

that would be a cool addition to this type of filter, the filter works at night, but does nothing during the day Big Teeth
Add Thank You Quote this message in a reply
Sep. 04, 2008, 12:56 PM
Post: #5
RE: Nocturnal Surfing
I converted it to a general css style for Stylish and added a:visited, a:active { color: #800080 !important } .This can be also inserted by proxo like showkills.css

Code:
@-moz-document url-prefix(http://), url-prefix(ftp://), url-prefix(file://), url-prefix(https://) {
* { background-color: #000 !important; color: #ccc !important; background-image: none !important; background: #000 !important; }
a { color: #7489ff !important; text-decoration: none !important; }
a:hover { color: #1689ff !important; text-decoration: underline !Important; }
a:visited, a:active { color: #800080 !important }
img {-moz-opacity: 0.35 !important; }
}
Add Thank You Quote this message in a reply
Sep. 04, 2008, 01:21 PM
Post: #6
RE: Nocturnal Surfing
Siamesecat: I'll look at your background color filter(s) again to gain some inspiration. I remember you had some pretty complex filters (with the hex code reg. ex.)

ProxRocks: replace the matching expression with this:

Code:
$SET(CHour=$DTM(H))$TST(CHour=([#22:24]|[#00:05]))
($TYPE(htm)((?)\0(^$TST(topmatched=1))$SET(topmatched=1)|(^*?)$STOP())$SET(1=<style type="text/css">
* { background-color: #000 !important; color: #ccc !important; background-image: none !important; background: #000 !important; }
a { color: #7489ff !important; text-decoration: none !important; }
a:hover { color: #1689ff !important; text-decoration: underline !Important; }
</style>\0)
|$TYPE(css)background(-(color|image)|) : ([a-z]|#)\9$SET(1=foo: \9)
|$TYPE(htm)<img$SET(1=<img style="filter:alpha(opacity=35) !important; -moz-opacity:0.35 !important"))

This will make it only active when it's 10:00pm - 5:59am Wink

Inminente, thanks! I'll need to test that out later today (I don't use Stylish, but I do use https://addons.mozilla.org/en-US/firefox/addon/4908 ) Smile!
Visit this user's website
Add Thank You Quote this message in a reply
Sep. 04, 2008, 05:06 PM
Post: #7
RE: Nocturnal Surfing
Dimming bright backgrounds has been a concern of mine for some time . There are several filters ( available here and over at the Yahoo Proxo forum ) which work very nicely ; however , for those of you that have a Samsung monitor , there is a very nice software from Samsung called MagicTune : http://www.samsung.com/us/consumer/learn...nload.html which is a godsend . It adjusts the colors and brightness with a click of the mouse and can be used to read text , watch video , play games . No fiddling with the dumb buttons on the bottom of the monitor .
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: