Karl Hans Janke Kollaborativ
Heute die Welt, morgen das Sonnensystem!

aug 2010

A tiny Lightbox work-alike in pure JavaScript


A little companion to fotogal has already silently made it into the repo: pixls displays images in a floating <div> atop the page with navigation buttons and metadata.

To use it with fotogal, just drop pixls.js next to the generated index.html. Everything else is already in place.

This one differs from the millions of other Lightbox clones in that it was invented here (har!), has no dependency on jQuery or another library and truly consists of only one file. No gifs, no css, just the JavaScript. Size is 8.5 kilobytes, 2.6 compressed.

Check the fotogal example for a demo. Basic usage instructions are in the source.

On the topic of compatibility: I have not tried it on Chrome, Opera or Safari. If you have, let me know. Alas, I will not be bothered with IE compatibility. That is all.

Update: (2020) The script was originally named pixpls in reference to harmless uses of that bit of Internet jargon. Considering the potential connotations, though, I want to avoid any ambiguity and rename it.

Moar shell scripting: quick and easy HTML foto galleries


Introducing fotogal: a shell script for quickly generating html galleries.

From the README:

basic operation

  • enter a directory containing .jpeg or .jpg files.
  • call fotogal.
  • wait. note automatic orientation adjustment according to exif data.
  • notice scaled images in _scale/.
  • notice thumbnails in _thumb/.
  • observe index.html. thumbnails are linked to scaled images.

Head over to the project page for more info, look at some example output, and get the code!

Update: (21:30) I'm sorry, the incompatibilities with non-BSD environments have been resolved. ;)

Update: (2020) The script was originally called fotogirl. While meant as a nod to a friend, it always sounded too much like a personification to sit comfortably.