Palagpat Coding

Fun with JavaScript, game theory, and the occasional outbreak of seriousness

Friday, November 06, 2009

Javascript Snippet: Flip Text Upside-down

This week I was playing with my Google Analytics account to see what was happening with my blogs; it turns out that my MUGEN blog is about a bajillion times more popular than this one. Guess I'm learning, as Arthur Conan Doyle did, that you don't get to pick what you're known for (sigh). That said, the most popular post here on the ol' Coding blog was this one, where I talked about my home-grown tag cloud generator. So, although Canvassa isn't going to be dropped, I'm going to pepper in more of these "snippets" types of articles from time to time... like today!

Back in April of this year, YouTube did an April Fool's joke where they turned their site upside-down by means of a sneaky little code snippet that swapped out all alphanumeric characters with characters that looked like upside-down versions of themselves (for example, 6 became 9, M became W, etc). Later, Paul Irish adapted the code into a jQuery plugin. Still later, I followed his lead and adapted the code as a Dojo plugin, and posted it on Twitter. But I never blogged about it here.

In fact, it's even been in one of my Github repositories for months now, completely undocumented save its internal code comments. Surprise!

Click here to flip all the posts on this page, re-arranging them from top to bottom, or click here to flip their text in place without moving it around.

I wanted to go back re-implement the code as a bookmarklet, but it's currently dependent on (and namespaced in) Dojo, so that didn't get done. Maybe for the next snippet.

Oh, also of note: I've re-arranged my site template a bit, moving navigation from the sidebar to the header, adding more social networking links to my profile, and pushing it further down the sidebar. This is part of my effort to harmonize all three of my blogs into a single site, and there will likely be more changes before that effort is complete.

Update, 11/30/2009: Some recent template changes to the blog have broken the dynamically-loaded code in this post; I'm working on a fix.

Labels: , ,

3 Comments:

  • At 8:59 AM , Blogger QualityPoint said...

    Hi
    First of all. Thanks very much for your useful post.
    There is a good Software Testing resource site, Have alook
    Free ebooks for Software testing and QTP
    Software testing questions and answers

     
  • At 12:45 AM , OpenID Bart said...

    nice post! haha, upside down text seems to be getting popular on facebook and twitter. anyway your dojo plugin is nice. and you also talked about the jquery plugin Paul Irish created. so just to cover all the javascript frameworks, i was looking at a bunch of upside down text sites and I noticed that this one, flip letters, uses MooTools. If you look at the javascript on that site you can see the MooTools code they use. and nice post! thanks.

     
  • At 4:50 AM , Blogger Buyog said...

    @Bart: Nice, I hadn't seen that Moo-powered site before. Making a version for the Facebook crowd seems like a no-brainer now that I think about it.

     

Post a Comment

Subscribe to Post Comments [Atom]

<< Home