I like tomatoes

Elbajs & the 2 long-standing problems of the web

For the past 3 months I've been working on what is now my main project, a pure javascript slide-show gallery.
Its name is Elbajs, it is ~12.5KB in size.

The first long-standing problem

When you surf the web, the heaviest part to load from a web server is, obviously, images.
How many MB of images does the average web page have? ~1.2MB (October 2014) according to http://httparchive.org/. And it is ~200KB more than it was 10 months before.

I think it's common sense to predict that this trend is destined to continue in the future.

E-commerce or web sites dealing with tourism need to show you a lot of images. Some blogs need it too. Many web sites need it conclusively.

Beautiful, big pictures (maybe full-width & full-height pictures) are pleasant to look at, they increase user engagement.

Unfortunately, you cannot predict which kind of device your user will use to view your website. Their options range from a not so fancy smartphone to a 27-inch-5k-retina iMac.

We have too many images, too many devices.

For these reasons we need to lazy load images ,multi-serve them (that is serving the right sized image for any screen), expose them in a touch enabled gallery - eventually a full-screen gallery. This is why I made Elbajs.

Still a lot of work to do

I can't believe how many times I've seen [beautiful] web sites with a huge amount of pictures, downloading all of them at once, not caring about the screen size.
The last one that I have recently visited was http://www.cntraveler.com/.

The second long-standing problem

The second problem is that we always depend on jQuery.
Whatever functionality you need to add to your web site, it is quite often a jQuery plugin. Thus you always need to load the however-big-it-is jQuery library before loading whatever-jQuery-based slideshow gallery.

Elbajs gives you the freedom to use any or no JS libraries at its side, since it doesn't have dependencies. Plus you can use it as an AMD module and load it asynchronously.

This is a big advantage in the era of JS MVC frameworks.

Here is the demo page.

Still working on it

At the moment that I published this article, elba js still needs some improvements, though I haven't met any issues yet.
Any advice or suggestions would be greatly appreciated.