In between classes today I updated the meter. It’s essentially the same script, just it changes background images now, instead of having transparent images. I only did it for the pretty-factor since I had made the nice stars already. Once I’ve written it into an un-intrusive script, which is turning out to be a bit harder than I thought, I’ll likely swap it back and make it some better graphics.
Still cool, and with a few more lines could actually be used.
Posted September 1st, 2006 - PermalinkUpdate: A newer version is outlined in this post.
Due to a discussion I had earlier today, I was thinking about how to make one of those little star meters where you can click to set the rating and they change colors. I took some time to code up this quick version.
I didn’t want to use image swapping, because that wouldn’t be as flexible. So instead, you change the background color and have a transparent cutout of the image you want over that. It’ll make more sense once I get an example made.
For now, here’s my prototype. It needs a lot of work to make it into a good script, but it’s a start. Example Here
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | var sets = Array(); function hover(level) { for(j = 1; j <= level; j++) { document.getElementById('S'+j).style.backgroundColor = "#0FF"; } for(k = (level+1); k <= 5; k++) { document.getElementById('S'+k).style.backgroundColor = "transparent"; } } function unhover(group) { for(j = 1; j < 6; j++) { if(sets[group] == null) { document.getElementById('S'+j).style.backgroundColor = "transparent"; } else { if(sets[group] >= j) { document.getElementById('S'+j).style.backgroundColor = "#F00"; } else { document.getElementById('S'+j).style.backgroundColor = "transparent"; } } } } function set(group,level) { sets[group] = level; } |
Well, I’ve gotten the new wordpress up, and finished up (I hope) my theme here. Hopefully there aren’t any little glitches in it, I’m bad at testing code out. Now I’ll start porting in all the content from the old site, which I’ve moved to static.velvetcache.org.
Don’t bother going there though, I hardcoded too much of the Smarty engine into it and so everything is broken since it’s moved to a new domain. Yet another thing to grep and fix :) Oh well, I really like wordpress, so it’s worth it.
Also, maybe it’s just me but I’m having issues with loading some pages, I think wp-cache is buggy, something else to figure out. If something doesn’t load, just try a few refreshes, sorry.
Update: Found the offending line of code, wp-cache should work nicely now :)
Posted August 27th, 2006 - Permalink