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

vjslider

v3.1.2

Published

Super small and responsive vanilla js slider

Downloads

13

Readme

vjslider - Vanilla JS Slider

vjslider is:

  • super simple
  • infinite
  • responsive
  • touch friendly
  • no dependencies
  • tiny 2.25kB gzipped
  • written in ES6
  • powered by WebPack
  • tested with Jest and Puppeteer

How to use?

HTML markup:

<div class="vjslider">
    <div class="vjslider__slider">
        <div class="vjslider__slide">Slide 1</div>
        <div class="vjslider__slide">Slide 2</div>
        <div class="vjslider__slide">Slide 3</div>
    </div>
</div>

Include styles:

<link href="dist/vjslider.css" rel="stylesheet">

Include vjslider library:

<script src="/dist/vjslider.js"></script>

Run slider:

// Init slider
const options = {};
const slider = new VJSlider(document.querySelector('.vjslider'), options);

// You can manually change slides by using next() and prev() functions:
slider.next();
slider.prev();

// You can destroy slider with
slider.destroy();

// You can reload slider (with alternative options if needed passed as argument to reload method)
slider.reload({numberOfVisibleSlides: 3});

Full example in demo directory.

Options

You can use following options:

numberOfVisibleSlides (default: 1) - display given number of slides in slider viewport.

Development

vjslider is build with WebPack. WebPack is responsible for building and linting JS files, building CSS from Sass files. If you need pure ES6 version, use script from ./src directory.

Install dependencies, webpack and run local server

npm install
npm start

Prepare production build

npm run build

Webpack has local server running after npm start command. To see the demo visit http://localhost:8363/demo

Run tests (webpack-dev-server must be up and running)

npm test