Thursday, March 10, 2011

URL Hunter: a Cool Game, but not HTML5

 Gaming in the URL bar



If you need a mindless morning diversion, URL Hunter (link opens in new tab), a simple ASCII text game that turns your URL bar into the playing field, fits the bill. Be forewarned though, it’s going to leave massive, meaningless tracks in your browser history. Still, if you don’t mind the history garbage, URL Hunter is surprisingly entertaining.

One thing URL Hunter is decidedly not is HTML5.


Its creator, developer Corey Johnson of Probably Interactive, calls URL Hunter “ridiculous” and clearly didn’t mean it as a serious effort. Nowhere on the page does he mention HTML5 (technically the page does use an HTML5 doctype, but otherwise there’s nothing HTML5 about it), but that hasn’t stopped several prominent tech news outlets from declaring that URL Hunter uses HTML5 and the canvas tag to work its magic. Further proof that no one uses view source anymore.


In fact URL Hunter just uses JQuery to call some custom functions that randomize a string of text in your URL bar, creating the game. URL Hunter isn’t doing anything you couldn’t do five years ago (which isn’t meant to diminish URL Hunter).


That said, we’d like to see a re-write of URL Hunter that does use HTML5. In particular, the HTML5 History API. New elements in the History API offer a way to visibly change the URL in the location bar without triggering a page refresh. The canonical example of why this is useful is a JavaScript slideshow where each new image has a permalink. Using the History API each new image can update the URL bar as the images change, but the page never needs to reload. You can accomplish the same thing now with # URLs, but the History API offers more complete URLs.


The History API works in Safari 5, Mobile Safari 4.2.1+, Chrome 8+, and Firefox 4 and, provided you use it correctly, gracefully degrades for browsers that aren’t up to the task. Mark Pilgrim recently added a chapter to his Dive into HTML5 that covers the History API in detail, complete with working demos. There’s also a simple example on HTML5Demos and the GitHub blog offers a behind the scenes look at how the site uses the History API to handle its “slider” navigation.


Granted, using the History API wouldn’t change much about URL Hunter, and apparently you don’t even need to use any HTML5 for the tech media to declare your efforts HTML5, but we’d be impressed.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes Powered by Blogger | DSW printable coupons