For some reason, the other day I was thinking about Junior Senior. I knew they had a pop hit something like 10 years ago but I just couldn’t place it at all: what it was called, what it sounded like, who they were, nothing.
Until this morning, when I looked them up and ended up watching the video for Move Your Feet on YouTube — and that was it, that video. It’s so good.
There’s just something about that super-happy, pixel art craziness. The dancing toast really clicked in my brain for some reason. I had to share — click the image below to load the gif.
Since 100 words about a 12-year-old pop track with an amusing video feels like I’m cheating you, dear reader, here’s some technical stuff about doing easy click-to-start gifs.
I wanted to share that toast clip but after reading Jacques Mattheij’s post The Fastest Blog in the World I was a little wary about dumping a 150KB image onto my front page just for a bit of whimsy. That attitude’s quite silly when you consider that the weight of the Primary Unit front page before this post went up was a full 883kB — nearly three-quarters of which is Tumblr’s crap that is out of my control. But anyway.
Here’s the code:
I grabbed the first frame and saved it as a png. At 1.5kB it wasn’t worth the extra request or bothering uploading the file, so I turned it into a base64 data URI and put it in-line (note the placeholder on line 2). From the command line:
uuencode -m infile remotename
remotename just gets included in the header line, which you ditch, but you have to give something to the command.
img by its ID. It registers an event handler so that, when the image is clicked, if the
src attribute is anything but the gif URL, it swaps it out and saves the old
src. Click the image again and it restores the old
src — in this case stopping the gif by substituting back in the data URI, but you could use it to swap two images or similar.