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

ls-slider

v0.8.9

Published

A lightweight JS/CSS slider

Downloads

4

Readme

ls-slider

A lightweight JS/CSS Slider with focus on native mobile touch controls

This plugin is still in the works and will need some additional adaptions and features before reaching 1.0.0. Please do NOT use this for production in its current state!!

Pre-release To-Do's

  • [ ] fix indicator scroll animation
  • [x] fix infinite scroll on mobile
  • [ ] fix initial slide position when infinite are active
  • [ ] add visible slides functionality
  • [ ] consider accessibility (might be done after initial release)
  • [ ] code cleanup

Post-release To-Do's

  • [ ] add lazy loading

Setup

ls-slider is initialized by passing the elements and options to a JS class. For example:

import Slider from "ls-slider";

const slider = document.querySelector(".slider-element");
const options = { infinite: true };

new Slider(slider, options);

Options

visibleSlides

| Type | Default | Description | | :--- | :--- | :--- | | Number | 1 | The amount of slides that should be visible in the slider |

startingIndex

| Type | Default | Description | | :--- | :--- | :--- | | Number | 0 | The slide index that will initially be displayed |

sliderElementClass

| Type | Default | Description | | :--- | :--- | :--- | | String | "" | A class that will be added to the individual slider elements next to ls-element |

touchControls

| Type | Default | Description | | :--- | :--- | :--- | | Boolean | true | This enables native touch controls, which allow native swiping to switch slides. This setting will only affect touch devices |

autoSlide

| Type | Default | Description | | :--- | :--- | :--- | | Boolean | false | Toggle for automatic sliding |

interval

| Type | Default | Description | | :--- | :--- | :--- | | Number | 5000 | Interval for the automatic sliding in ms |

direction

| Type | Default | Description | | :--- | :--- | :--- | | SlideDirection ("left", "right") | SlideDirection.Right ("right") | The direction of the automatic slide |

previousButton

| Type | Default | Description | | :--- | :--- | :--- | | String | "" | <button class="ls-previous-button"></button> |

nextButton

| Type | Default | Description | | :--- | :--- | :--- | | String | "" | <button class="ls-next-button"></button> |

infinite

| Type | Default | Description | | :--- | :--- | :--- | | Boolean | false | Toggle for infinite styling |

indicators

| Type | Default | Description | | :--- | :--- | :--- | | Boolean | true | Toggle for indicators |