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

image-carousel-slider

v1.0.1

Published

## Description

Downloads

1

Readme

image-carousel-slider

Description

This JS function will create an image gallery slider by taking images the user has labeled with class name slide-image and placing them into a container the user has labeled image-slider.

GitHub Repository

Live Preview Example

How to use

Without NPM

  • Download the file here and include the following <script> tag in the head of your html document.

  • <script src='path/to/file/main.js' defer>

  • Then for the images you want to have displayed in the image slider add the class name slide-image.

  • You will also need to create a container such as a div to container the image slider and add the class name image-slider.

  • Example:

    <div class="image-slider"></div>
    <img src="./path/to/pic1.jpg" alt="" class="slide-image" />
    <img src="./path/to/pic2.jpg" alt="" class="slide-image" />
    <img src="./path/to/pic3.jpg" alt="" class="slide-image" />
    <img src="./path/to/pic4.jpg" alt="" class="slide-image" />
    <img src="./path/to/pic5.jpg" alt="" class="slide-image" />

With NPM (preferred)

  • Enter the following into the command line: npm i image-carousel-slider

  • There are three ways to use this module with NPM

    1. Without a module bundler: The steps are the same as without NPM except add the following script tag to the head of your html file: <script src='node_modules/image-carousel-slider/dist/main.js' defer>

    2. With bundler nodes already added to html document: Simply add the following line to the import list of your index.js file: import 'image-carousel-slider'

    3. If adding the links programmatically add the following line after appending your links: makeImageSlider();

      Example:

    import {makeImageSlider} from "image-carousel-slider";
    
    const imageSlider = document.createElement("div");
    imageSlider.classList = "image-slider";
    document.body.appendChild(imageSlider);
    
    const img1 = document.createElement("img");
    img1.classList = "slide-image";
    img1.src = require("./path/to/pic1.jpg");
    
    const img2 = document.createElement("img");
    img2.classList = "slide-image";
    img2.src = require("./path/to/pic2.jpg");
    
    const img3 = document.createElement("img");
    img3.classList = "slide-image";
    img3.src = require("./path/to/pic3.jpg");
    
    const img4 = document.createElement("img");
    img4.classList = "slide-image";
    img4.src = require("./path/to/pic4.jpg");
    
    makeImageSlider();

How to Style

To change the default sizing use class image-slider;

Example:

.image-slider{
    width: 80%;
    height: 80%;
}

Bugs and suggestions

  • Report bugs and suggestions here

Motivations

The motivations behind this project are to practice creating commonly used JS web functions using standard JS and practicing publishing node packages.