nostromos bLog






* all entries (445)
* concerts (28)
* misc (120)
* techtalk (18)
* travel (241)
  `-bruxelles_07 (8)
  `-canada_14 (22)
  `-hongkong_09 (13)
  `-iceland_10 (14)
  `-ireland_16 (7)
  `-japan_13 (22)
  `-paris_06 (1)
  `-poland_10 (3)
  `-russia_10 (12)
  `-scotland_15 (11)
  `-sweden_09 (10)
  `-taiwan_12 (22)
  `-tokyo_08 (14)
  `-usa_09 (10)
* zoo (38)
  `-abroad (8)
  `-linz (3)
  `-misc (11)
  `-schoenbrunn (16)


08(01), 07(03), 06(03), 05(02), 04(02), 03(02)
12(02), 11(01), 10(08), 09(03), 07(17), 06(01), 05(04), 04(03), 03(02), 02(02), 01(06)
12(05), 11(02), 10(01), 09(01), 08(02), 07(04), 06(01), 05(02), 04(03), 03(02), 02(02), 01(01)
12(01), 11(02), 09(09), 08(16), 07(02), 06(03), 05(04), 04(03), 02(03), 01(02)
12(03), 11(01), 10(02), 09(01), 08(23), 07(03), 06(02), 05(01), 04(02), 03(02)
12(03), 11(02), 10(01), 09(01), 08(23), 05(02)
09(04), 08(01), 06(01), 05(02), 04(02), 03(01), 02(01)
11(01), 10(02), 09(15), 08(01), 07(02), 06(04), 04(12), 01(06)
12(05), 11(01), 10(06), 09(12), 08(02), 07(02), 06(01), 05(01), 04(10), 02(01), 01(05)
12(02), 08(01), 07(15), 06(02), 05(03), 02(02), 01(03)
12(05), 11(01), 07(24), 06(06), 05(03), 04(02), 01(01)
12(01), 11(01), 10(07), 09(01), 08(04), 07(05), 06(04), 05(06), 04(01), 03(04), 02(06), 01(04)
12(04), 11(02), 10(03), 09(04), 08(03), 07(04), 04(01)
07(01), 05(01)
08(01)
10(01)

Wed, 01 Jun 2011
site css (0 comments)
ok, after a veeeeeeery long time here's a tiny bit of nerdy tech bLog blabla. just a itsy bitsy nerdy one - i promise. well, i always thought about giving my homepage an additional inverted colour look, since loads of people always complained it's so dark and gothic and whatever. problem was, there are - by now - tons of galleries, or other links on my homepage. so this would mean a lot of changes if i would go through all those files by hand. but... of course there must be a better and also easier way out. and there was... luckily. i already had cleaned out the gallery sites to use only one css file a while ago - that was a big messy sed-battle that took my brain quite a while to process and get it right. also i had the css file itself cleaned (though i'm not a master of css styling, to be honest). same applied to the bLog css files - cleaned a while ago. so everything was ready for the big switch to be implemented. and here's how the trick works... 1. cgi scripts: for each css file, put a cgi-script in place that delivers all content of type "text/css". for me there were three files: the main sites css file, the gallery css and the bLog css file. also include some nice query_string and referer processing to deliver alternative css styles. perl (with "-w" and, of course, "use strict;") did the trick here - what else? 2. apache2 config: next, do some mod_rewrite + apache2 magic. create a rewrite rule that meets the following requirements: a) the query_string does not contain any alternate-style index ("a=<style_index>", where "style_index" can be one of "n"ormal, "i"nverted, "r"otated, or "f"lipped), b) the request_uri is not for a css, jpg, gif, png, or ico file, since there's no css to apply to those file types anyway, c) the http_referer contains some alternate-style index. if all those criteria meet, rewrite the url and append the alternate-style index to the request_uri to have the perl script from 1. deliver the right css content again. simple as that, here's what it looks like in the apache2 config file:
RewriteEngine On RewriteCond %{QUERY_STRING} !^a=[irfn]$ RewriteCond %{REQUEST_URI} !^/(.*)\.(css|jpg|gif|png|ico)$ RewriteCond %{HTTP_REFERER} ^(.*)(\?a=[irfn])$ RewriteRule ^/(.*)$ $1%2 [R,L]
3. apache2 mod_expires: set expire headers in apache2's mod_expires config for css files to zero, since they now are highly dynamical.
ExpiresByType text/css A0
4. inverted random images: modify the cgi script that delivers the random images at the bottom of the page to provide inverted images in the inverted mode, or deliver colour inverted post-graph on the bLog site. 5. make links on the main page to the alternative styles: easy. this all worked surprisingly well, only the css magic for the rotate and flip effect are... still a bit messy and unpredictable when it comes to browser compatibility. but... since this is just a nice bonus i hadn't planned to implement anyway, i'm fine with that. so, feel free to enjoy the new site in inverted, rotated, or flipped style. or the inverted bLog. but no rotated or flipped one, since the css here really totally messes the site layout up. oh, and i think the inverted style looks awful. but, that's what people get when they complain about the wonderful, beautiful, nice, well balanced, eye pleasing & catching, well thought out, lovingly assembled cyan/black combination. don't blame me.

top [
^
]

[ prev | index | next ]