Rotates.org

November 28, 2009 - ColorShift 0.6

Sooner rather than later it seems, you can now download Rotates ColorShift 0.6 and bask in its amazingness.

The main change is how you set your selectors; instead of writing your own jQuery to target the elements you want to change, you feed rotColShiftOpts.cssTransforms with an array of objects. This is what Rotates.org uses:

[
	{
		selector: "a, h2, h3, h4, h5",
		styles: [
			"color"
		]
	},
	{
		selector: "#header, #searchsubmit",
		styles: [
			"background-color"
		]
	}
]

Actually it was a bit of a struggle, as I wanted to abandon the DOM-based approach to changing the CSS of every individual element, and go for a global stylesheet change. Easy you say? Just .append/.text a style element. Well, yes, in all decent browsers. Sadly, the IE family seems unwilling to let you tamper with the style element so easily, and jQuery (at the moment) has no elegant way around it. So out came the ‘Lew hacking pants’ with the following solution:

ieStyle = document.createStyleSheet();

$.each(rotColShiftOpts.cssTransforms, function(i, ttrans) {
	newColor = getColorWithOffsets(hue, saturation, brightness, ttrans.offsets);
	var tstyles = "";
	$.each(ttrans.attributes, function(i, ts) {
		tstyles += ts + ": " + newColor + ";";
	});
	tmpTransforms += ttrans.selector + "{ " + tstyles + " } ";
});

if ($.browser.msie) { // *sigh*
	ieStyle.cssText = tmpTransforms;
}
else {
	$("style[title='colshift']").text(tmpTransforms);
}

Anyway the result is that you a) get a better, easier to use syntax for applying the changes to page elements, and b) can be safe in the knowledge the styles will be applied to all elements on the page (even generated ones)  just like CSS should be. Enjoy!

May 12, 2009 - Chaos Enhanced

I’m now officially on the war path with my Chaos remake; I’m chasing Julian Gollop, and I’m spending a lot of time planning the details of the server. It’s proving to be easily the largest and most complex project I’ve ever tackled by a huge margin, and so I want to get things right from the beginning, rather than turn the codebase into hacks supporting hacks.

As a result of the work I’ve been doing lately, I think it’s now safe to ‘release’ the unfinished, somewhat buggy original Flash version that I did a while back. It’s no indication on the way the new rewrite is going to look (the interface is as temporary as it gets, for instance) but it shows some of the ideas I’ve had – not least being the move to an isometric viewpoint.

Two turns in and it's already going nuts - ah I love Chaos!

Two turns in and it's already going nuts - ah I love Chaos!

Anyway, without further ado, here’s the link. There’s no real configuration, no multiplayer, and gooey blobs, magic fire and mounts can act decidedly strangely at times, and these bugs were the reason I abandoned this codebase – the main class alone had turned into a thousand lines of semi-procedural hacks!

March 17, 2009 - ColorShift initial release

As promised, I’ve added the slightly fettled version of ColorShift (as it’s now known – yes I’m English, no I won’t spell it ‘colour’ because I’m a webdev) to the site. Currently it’s in a pretty sorry state and only just works via the crutches of pure hackery that keep it standing…

… okay a bit melodramatic but you get the gist. Go get it!