PhotoViewer with CSS Transition Goodies
Wednesday, April 14th, 2010I wanted to play with the new CSS transition stuff, to see what all the fuss was about. At the same time I wanted to make something useful, so I thought why not make a little site for my friend Dave, who is one bad ass photographer. I have a rough demo up and it works pretty well. It only works with Safari 4, but the good news is that it also works with Mobile Safari.
It’s really nice that the animation is defined in the CSS and you don’t need any JavaScript to move objects. It was also really simple to implement, most of the work was done in about an hour. The interaction is simple. Click a picture to zoom into it, then a full version loads, click on it and you zoom back out. You can also move the thumbnails around.
I had to violate some ui for the iPad because of the way mobile safari handles events, or more precisely, doesn’t handle events. I wanted to maintain the native gestures of but weirdly enough safari does fire any events when double tapping to zoom in, as stated in their documentation. Why?
I decided implementing my own photo uploading/managing would be too much of a pain in the ass, after all Dave isn’t paying me for this. Yes, this may come as a shock, but I’m not a total asshole. So I decided to use Flickr as a CMS. Since the API allows for a JavaScript callback, there’s no backend proxy work required.
Anyway, here’s a little taste of how it works. You need Safari 4 or iPhone OS 3. Currently, there are three different ways to load photos.
1) Load from a JSON file
Loading a JSON file, don’t pass any query terms: http://mud.mitplw.com/PhotoViewer/
The actual JSON file is: http://mud.mitplw.com/PhotoViewer/index.json
2) Load Photosets from a Flickr user
Pass a photoset=flickr_user_id query, like this (using Luis’s Flickr account)
http://mud.mitplw.com/PhotoViewer/?photoset=75903973@N00
HINT: you can look up user_ids with idGettr.
3) Load Photos from Flickr using tag search
Pass any comma delimited tags like ?drunk,punks
http://mud.mitplw.com/PhotoViewer/?drunk,punks
Finally, I’ll post the source on github when I finally finish Dave’s site. Also, maybe in the near future I’ll add some local storage and HTML5 video support…



