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

@benjamin-gambling/image-carousel

v1.0.1

Published

A simple image carousel built with JS where you can add as many images as you like

Downloads

1

Readme

Image Carousel

Image Carousel

Table of contents

  1. Demo
  2. Technologies
  3. Features
  4. Development
  5. License
  6. Installation

Demo

Here is the working live demo: https://benjamin-gambling.github.io/image-carousel/.

Technologies

Features

  • Add as many pictures as you want through the html file
  • Next & Previous Controls
  • Idicators made through CSS to see position and also to navigate further along or back
  • Slide Show that fades pictures in every 5s

Devlopment

  • Random picture selection

License

You can check out the full license here

This project is licensed under the terms of the MIT license.

Installation

  1. In you project directory copy and paste:- npm i @benjamin-gambling/image-carousel --save

  2. Then in you Javascript file use: - import imageCarousel from "@benjamin-gambling/image-carousel";

  3. Edit Html to add/remove slides (Idicators create themsleves so that doesnt need to be touched)

HTML: -

<div class="carousel">
      <div class="carousel-item fade show">
        <img class="carousel-img" src="images/slide1.jpg" alt="Slide 1" />
      </div>

      <!--Second slide-->
      <div class="carousel-item fade">
        <img class="carousel-img" src="images/slide2.jpg" alt="Slide 2" />
      </div>

      <!--Third slide-->
      <div class="carousel-item fade">
        <img class="carousel-img" src="images/slide3.jpg" alt="Slide 3" />
      </div>

      <!--rinse and repeat for more images-->
      <div class="carousel-item fade">
        <img class="carousel-img" src="images/slide4.jpg" alt="Slide 4" />
      </div>

      <div class="carousel-item fade">
        <img class="carousel-img" src="images/slide5.jpg" alt="Slide 5" />
      </div>

      <div class="carousel-item fade">
        <img class="carousel-img" src="images/slide6.jpg" alt="Slide 6" />
      </div>
    </div>

    <a
      class="carousel-control-prev"
      href="#indicator"
      role="button"
      data-slide="prev"
    >
      <i class="fa fa-chevron-left"></i>
    </a>
    <a
      class="carousel-control-next"
      href="#indicator"
      role="button"
      data-slide="next"
    >
      <i class="fa fa-chevron-right"></i>
    </a>

    <!--Controls-->

    <!--INDICATORS: Leave as they are JS will append these depending on how many images-->
    <div class="carousel-indicators"></div>

  CSS: -
    * {
      box-sizing: border-box;
    }

    html,
    body {
      overflow-x: hidden;
      overflow-y: auto;
      display: flex;
      justify-content: center;
      background-color: rgba(0, 0, 0, 0.7);
    }

    body {
      background-color: transparent;
    }

    .carousel {
      display: flex;
      margin-top: 100px;
      width: 1300px;
      height: 705px;
      justify-content: center;
    }

    .carousel-item {
      display: none;
      opacity: 0.85;
      width: 100%;
      height: 100%;
    }

    .carousel-img {
      min-width: 100%;
      min-height: 100%;
      width: 1300px;
    }

    .show {
      display: block;
    }

    .carousel-control-next,
    .carousel-control-prev {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      margin-top: -50px;
      padding: 15px;
      color: rgba(255, 255, 255, 0.75) !important;
      font-size: 35px;
      transition: 0.6s ease;
    }

    .carousel-control-next {
      right: 0;
    }

    .carousel-control-prev {
      left: 0;
    }

    .carousel-control-next:hover,
    .carousel-control-prev:hover {
      background-color: rgba(0, 0, 0, 0.1);
      color: rgba(255, 255, 255, 1) !important;
      font-size: 45px;
    }
    .carousel-indicators {
      position: absolute;
      top: 90%;
      width: 100%;
      text-align: center;
      margin: 0px auto;
    }

    .indicator {
      display: inline-flex;
      padding: 6px;
      cursor: pointer;
      height: 15px;
      width: 15px;
      margin: -50px 5px 0px 5px;
      background-color: rgba(255, 255, 255, 0.25);
      border-radius: 50%;
      transition: background-color 0.6s ease;
    }

    .indicator:hover,
    .active {
      background-color: rgba(255, 255, 255, 1);
    }

    /* Fading animation */
    .fade {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 3s;
      animation-name: fade;
      animation-duration: 3s;
    }

    @-webkit-keyframes fade {
      from {
        opacity: 0.1;
      }
      to {
        opacity: 0.85;
      }
    }

    @keyframes fade {
      from {
        opacity: 0.1;
      }
      to {
        opacity: 0.85;
      }
    }