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

stlightbox

v1.1.36

Published

Stlightbox is a lightweight and customizable JavaScript lightbox plugin that allows you to display images and videos in a beautiful overlay.

Downloads

27

Readme

Stlightbox - JavaScript Lightbox Plugin

Stlightbox is a lightweight and customizable JavaScript lightbox plugin that allows you to display images and videos in a beautiful overlay with various configuration options.

Features

  • Display images and videos in a responsive lightbox.
  • Customizable appearance and behavior.
  • Keyboard navigation for easy gallery navigation.
  • Download button for image downloads.
  • Pagination support to show the current image position.
  • Dark and light themes with automatic theme detection.

Installation

You can install Stlightbox by including the JavaScript and CSS files in your project. You can download the latest release from the GitHub repository or use a package manager like npm or yarn:

npm install stlightbox

Usage

To use Stlightbox in your project, follow these simple steps:

  1. Include the CSS in your h:
<link rel="stylesheet" href="path/to/stlightbox.css" />

<script src="path/to/stlightbox.js"></script>
  1. Wrap your image or video i tag with the same href. Add the data-stlightbox attribute to the tag you want to include in the lightbox:
<!-- FIRST GALLERY -->
<a href="image1.jpg" data-stlightbox="stellar-solutions">
    <img src="image1.jpg" alt="Image 1" />
</a>
<a href="image2.jpg" data-stlightbox="stellar-solutions">
    <img src="image2.jpg" alt="Image 2" />
</a>

<!-- SECOND GALLERY -->
<a href="image3.jpg" data-stlightbox="stl-gallery">
    <img src="image3.jpg" alt="Image 3" />
</a>
<a href="image4.jpg" data-stlightbox="stl-gallery">
    <img src="image4.jpg" alt="Image 4" />
</a>
  1. Initialize Stlightbox in your JavaScript code:
const lightbox = new Stlightbox({
    // Configuration options (see below)
});

lightbox.initialize();
  1. Customize the appearance and behavior of the lightbox by providing configuration options (see the Configuration section below).

Configuration

You can customize the behavior and appearance of Stlightbox by passing configuration options when initializing it. Here are the available options:

| Option | Description | Default Value | | -------------------- | ------------------------------------------------- | -------------------------- | | lightThemeBackground | Background color for the light theme | 'rgba(255, 255, 255, 0.5)' | | darkThemeBackground | Background color for the dark theme | 'rgba(100, 100, 100, 0.5)' | | showDownloadButton | Show a download button for images | false | | keyboardControls | Enable keyboard navigation | true | | videoAutoplay | Autoplay videos in the lightbox | false | | pagination | Enable pagination | false | | paginationSeparator | Separator between current and total in pagination | 'of' | | loop | Enable loop navigation | false |

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Icons used in the lightbox are provided by Heroicons.

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.