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

slideshowgl

v1.0.6

Published

WebGL2 powered slide show with advanced transition animations

Downloads

2

Readme

SlideShowGL

npm npm

SlideShowGL is a javascript-library that you can ues to render images on your website with advanced transformation aniamations.

You can have a look at the already implemented animations on my homepage:

https://mrsoir-fb.firebaseapp.com/SlideShow

Install

I published SLideShowGL as an npm-package. To Install it, use:

npm i slideshowgl

Usage

Because SlideShowGL is powered by WebGL2, you need to create a canvas-tag:

HTML:

<canvas id="<your_canvas_id>"/>
// it is importat to an id to the canvas. SlideShowGL internally access the canavas by calling:
// document.getElementById('<your_canvas_id>');
// of course you can create multiple SlideShowGL-canvases per site!

Javascript:

  1. import the module
// import:
const SlideShowGL = require('slideshowgl');
  1. Use the module:

    1. instantiate SlideShowGL:
let sldShw = new SlideShowGL('<your_canvas_id>'); // this is why it is mandatory to assign an id to your canvas-tag
if( sldShw.supportsWebGL2() ){
	// only continue if your browser supports WebGL2!!!
}
  1. start the animation:
let slMeta = {
	// mandatory:
	imgPaths: ['path0.png', 'path1.png', 'path2.png'   ],
	// OR:
	images: [new Image()-Objects],

	// optional:
	animationDuration: 3 * 1000,  // 3 seconds
	delayDuration: 5 * 1000, // 5-seconds time lag between image-transitions
	backgroundColor: [0,0,0, 0.0], // transparent background
	animationType: 'Gravity',
	splitDepth: 15 // the image will be split into 2^15 = 32,768 polygons
};
let startedSuccessfully = sldShw.startAnimation(slMeta);
if( !startedSuccessfully ){
	// handle error!
}

The default animation is 'Gravity'. To get a full list of the available animations from which you can choose, you can call:

let animations = SlideShowGL.getAnimationIdentifiers();
// getAnimationIdentifiers is a static function of the SlideShowGL-Class that returns an array of strings

You can use one of these strings to set the animationType. By calling startAnimation(slMeta), you have to create a JavaScript-Object that at least contains either:     - imgPaths: array of strings     - images: array of 'new Images()'-Objects If you forward imgPaths to the startAnimation-function, SlideShowGL will load the images itself. This may take a while depending on the image-sizes and bandwidth. To avoid loading times, you can also load the images yourself and forward the images directly as an array of 'new Images()'-Objects. If you forward imgPaths, then you might want to know, when the loading of the images is completed. You can add a callback-function, that will be called when all images are loaded, right before the animation starts:

sldShw.onImagesLoaded = ()=>{ do something    };

This comes in handy, if you e.g. want to hide the canvas or execute a waiting-indicator as long as the images are still loading.