Stopping to get petrol on my way home tonight, I felt a little hungry and decided on a “Surfie Pie” to fill the void in my stomach. As it would turn out, a Surfie Pie is barely fit to be called a pie. A Surfie Pie is a goddamned quiche. Don’t get me wrong, I like quiche as much as the next guy (possibly moreso, particularly when apparently “real men don’t eat quiche”) but when I want a pie, I want a freakin’ pie!
Aside from that it’s been a rather lazy, stress-free day. I separated decaf’s colour/image schemes from it’s layout styles, thus creating two style sheets. This allows for a little more flexibility in the site’s appearance; so expect a new “theme” in the next few days. I figure I could add a new theme every month or so, just to spice things up.
Posted by Chris Clark on March 27, 2003 at 2:22 AM
I’ve been working doggedly at this whole “theme” deal this afternoon and have reached several conclusions:
- Though Gecko browsers and Opera 7 for Windows offer built-in style sheet switching capabilities, this ability is useless because the styles don’t stick. Refreshing the page reverts back to the original theme.
- Paul Sowden’s excellent Javascript Style Switcher fixes this problem through clever DOM manipulation whilst simultaneously enabling in-page style switching for people without the above browsers. Unfortunately, the javascript falls flat when the user doesn’t have it enabled. At first I thought that it just didn’t work in Opera 7 and couldn’t work out why… then I remembered that I’d downloaded the much-lighter “non-java” version of Opera 7. In other words, I’m a dick. But it proves my point about Javascript and justifies the ill-will I feel towards it… at least in my mind.
- My own PHP switcher has the unfortunate problem of only working for in-page switching. In other words, it’s not as seamless a function as the Javascipt solution (to Gecko and Opera users) because it doesn’t communicate with the style-selection menus that those browsers offer. This shits me.
So what is a concerned webmaster supposed to do? For now I plan to sit on my hands, that’s what. The new theme will launch on Tuesday (the first of next month) without a switcher for anyone. Such is life.
Posted by Chris Clark on March 27, 2003 at 6:14 PM
As a sidenote, I’d like to point out that my original PHP Switcher was riddled with security holes and I thoroughly recommend Rob Ballou’s adaptation of the code instead. Why would I willfully shun my own code? To be perfectly honest, the hook of that article was the “just five lines of code” mentioned in the blurb. I can assure you that a more secure, more thorough script takes much more than five lines of code; but every article (like every song) needs a hook. The brevity of code in my switcher was mine.
Brevity is, after all, the soul of wit.
Posted by Chris Clark on March 27, 2003 at 6:43 PM
In non-site-related news, today I participated in that psych. department experiment I mentioned on Thursday. It was, by and large, a tedious exercise involving riding an exercise bike and testing the effect that the increased heart rate had on my eyes. Invigorating.
Posted by Chris Clark on March 27, 2003 at 6:55 PM
It turns out I was wrong (what, again?). Opera’s failure to work as expected with the JavaScript Style Sheet Switcher had nothing to do with the “non-java” version I downloaded. Actually, it’s quite capable of handling Javascript. As it turns out, my testing of the various abilities of the JSSSS wasn’t uniform. I hadn’t removed enough variables. It was downright unscientific. Take Jay Zee’s site (that’s Jeffrey Zeldman to you); it uses the JSSSS to switch between its white and orange styles, as well as a different JavaScript function for “Toggl(ing) Externals”, and Opera does a stand-up job handling it. Hit “Refresh”, though, and the style you chose is gone. Blammo.
This is startlingly inconsistent with A List Apart’s use of the JSSSS, where the fonts are controlled. The fonts stay on their selected setting, even through a refresh. This is especially puzzling considering that they use the same JSSSS code. Again, I abandon all hope of JavaScript offering any real functionality in life. My dilemma is solved; PHP switching will be installed come Tuesday.
Posted by Chris Clark on March 27, 2003 at 9:04 PM