Tag Archives: Code

Crouching Lemming Hidden Background

Lemmings

More CSS experimentation with the site. Hover over the menu bar up there. Go on, I’ll wait. Whee, Lemming!

The image is a simple animated GIF I put together after a quick Googling. Initially I just wanted to stick the Lemming somewhere unobtrusive on the page, but after a bit of experimenting there’s really nowhere you can put it that doesn’t get a bit distracting and annoying – there’s a reason always-on, auto-playing animations mostly died with Geocities. So I opted to stick it on the menu bar and only appear on mouse over. In itself that’s easy enough – add a “:hover” selector to the menu element and it’s done. But it looks a bit jarring just flicking on and off as you move the mouse around the page so I started looking into having it fade in and out. Since I’ve no idea how to mess with the actual code of a WordPress site or theme it had to be a CSS-only solution.

At first it wasn’t looking hopeful, since it really is the kind of thing people automatically go to Javascript for and with good reason. But eventually I unearthed the fact that Chrome supports transitions on background images. Woo! I did get tripped up by the fact that if you aren’t fading from another image (and one the same size at that) it not only fades but resizes as well. Easy fix, just use another image as the default non-hover background and fade from that.

The code is all below the cut.

Read More →


Detecting if another instance of an application is already running

Back in Alpha 1.3 of Picsie, one of the features I added was to have the windows position differently depending on if there were already Picise instances loading.  This isn’t as simple as it sounds, and I ended up prostrating myself at the feet of Stack Overflow, begging for wisdom.

Here’s what I learned.

Read More →