npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lc-gif-player

v1.0.0

Published

A javascript player.. for GIFs!

Readme

LC GIF Player

Prior note: this is a libgif-js fork. A very nice javascript piece to manipulate animated GIFs, by BuzzFeed

This tiny project born since I had the necessity to create a GIF player for my product documentations. GIFs are easy to be implemented and maintained, then sometimes are better than videos.

So.. here it is! A reponsive GIF player featuring preloader, prev/next commands and a fullscreen mode. It is pure javascript and CSS, then is super quick to be implemented and customized.

Supports any modern browser

 

How to use

Easiest way to get started is to play with the demo.html file. Here's the code used:

<!doctype html>
<html>
<head>
	<link href="lc_gif_player.css" rel="stylesheet">
</head>

<body>
	<div class="gif_player">
		<img src="" rel:animated_src="path/to_the_image.gif" />
	</div>
	

	<script type="text/javascript" src="lc_gif_player.pack.js"></script>

	<script type="text/javascript">
	document.addEventListener("DOMContentLoaded", function(event) {   
		lc_gif_player('.gif_player');     
	});
	</script>
</body>
</html>

 

Function parmeters

lc_gif_player function has got one mandatory and 3 optional parameters:

  1. DOM element selector (string) (mandatory)     whatever you may target through querySelectorAll javasctipt function

  2. Autoplay (bool)     true if you want to autoplay the GIF once loaded. By default is false

  3. Extra classes (string)     you may need to add extra classes to player's wrapper. Just write them together in a single string

  4. Hidden commands (array)     you can hide prev/next and fullscreen comands by inserting move and fullscreen keywords inside an array

 

Here's a complete example

<script type="text/javascript">
lc_gif_player('.target_2', true, 'class1 class2', ['move', 'fullscreen']);
</script>

 

One last thing: same-domain origin

The gif has to be on the same domain (and port and protocol) as the page you're loading.

The library works by parsing gif image data in js, extracting individual frames, and rendering them on a canvas element. There is no way to get the raw image data from a normal image load, so this library does an XHR request for the image and forces the MIME-type to "text/plain". Consequently, using this library is subject to all the same cross-domain restrictions as any other XHR request.


Copyright © Luca Montanari - LCweb