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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sprite-player

v1.0.2

Published

Web component for controlling sprite sheet animations.

Downloads

4

Readme

<sprite-player>

Web component for controlling sprite sheet animations.

npm version

npm install --save sprite-player

Demo

https://positlabs.github.io/sprite-player/examples/

run animation

Quickstart

<!-- load the x-tag lib -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/x-tag/1.5.11/x-tag-core.js'></script>

<!-- load sprite-player component -->
<script src='node_modules/sprite-player/docs/sprite-player.js'></script>

<!-- use it! -->
<sprite-player src="./assets/run.png" rows="1" cols="8" fps="12" autoplay loop></sprite-player>

Documentation

Attributes

src: (string) Path to sprite image.

frames: (int) Number of frames in the animation. Defaults to rows * cols.

rows: (int) Number of rows in the sprite.

cols: (int) Number of columns in the sprite.

fps: (Number) Frames per second.

autoplay: (Boolean) Automatically play the animation as soon as the src is loaded.

loop: (Boolean) Automatically replay the animation when it ends.

Properties

Note: All attributes are accessible as properties.

paused: (Boolean) State of the animation.

duration: (Number) Duration of animation in seconds.

Methods

play: Plays the animation. Sets paused to false. pause: Pauses the animation. Sets paused to true.

Events

play: Sent when playback of the media starts after having been paused; that is, when playback is resumed after a prior pause event.

playing: Sent when the media begins to play (either for the first time, after having been paused, or after ending and then restarting).

pause: Sent when playback is paused.

ended: Sent when playback completes.

loadstart: Sent when loading of the media begins.

load: Sent when media is loaded.

error: Sent when media failed to load