gifsee.js
A modern, vanilla JavaScript gif previewer and loader.
gifsee.js: a 2.8kb gif previewer
A vanilla JavaScript gif previewer in the Facebook style, about 2.8kb minified, that skips ES5 transpilation and leans on Fetch, arrow functions, and Promises.
Small and framework-free
gifsee is a modern, vanilla JavaScript gif previewer and loader, inspired by a jQuery plugin but built without jQuery. At roughly 2.8kb minified it is a deliberately light dependency for showing gif previews on a page, small enough that the cost of including it stays near zero. The vanilla approach means no framework to load alongside it and no build step to feed the library through, which fits the sort of page where you want a previewer without adopting a framework for it.
Modern browser only
The library unapologetically uses modern JavaScript and does not transpile back to ES5. It relies on Fetch, arrow functions, Calc, and Promises, which means it targets current browsers rather than the long tail of old ones. For older browsers the README recommends adding a Fetch polyfill rather than downgrading the library. That stance keeps the code simple and the size down, and it is refreshingly direct about the browser baseline.
Install and the constructor
For now gifsee supports classic scripts, with module support promised, so you grab the latest file from the dist folder and add it to the page, or clone the whole repo. The constructor takes a single parameter, an HTMLImageElement, and the src should point at a preview image of the gif, where any image works but the width ideally matches the gif so the preview lines up with the real animation. The image element is both the input and the target the preview loads into, so there is no wrapper to configure.
Community notes