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

cloudinary-lightbox

v0.2.4

Published

Create an optimized lightbox for your site's images using Cloudinary

Downloads

24

Readme

Cloudinary Lightbox

A JavaScript widget for auto-generating responsive, accessible lightboxes using Cloudinary.

All Contributors

Installing

Using a CDN

The quickest way to get started is to add the minified production bundles from the Unpkg CDN:

Place the following default theme CSS before the closing </head> tag:

<link href="https://unpkg.com/cloudinary-lightbox@latest/dist/cloudinaryLightbox.css" rel="stylesheet" type="text/css">

Place the following script before the closing </body> tag:

<script src="https://unpkg.com/cloudinary-lightbox@latest/dist/cloudinaryLightbox.js"></script>
<script>
    var CloudinaryLightbox = CloudinaryLightbox({
        cloudName: "YOUR_CLOUD_NAME"
    })
</script>

Using NPM

If you're looking to include the plugin as a part of your build process, install using NPM:

npm install cloudinary-lightbox

Then include the files as necessary in your app entrypoint, e.g in Parceljs:

import CloudinaryLightbox from "cloudinary-lightbox"
import "cloudinary-lightbox/dist/cloudinaryLightbox.css"

const cloudinaryLightbox = new CloudinaryLightbox({
    cloudName: "YOUR_CLOUD_NAME"
})

Usage

Cloudinary Lightbox is plug-and-play out of the box. The default stylesheet will give you fullscreen image lightboxes for every image you select when instantiating the plugin.

Configuration

When instantiating the plugin, the following options are available:

| Name | Type | Description | Default | | --- | --- | --- | --- | | selectors | string | A comma delimited list of valid CSS selectors to target specific images | img | | attributes.src | string | The HTML attribute to search for the image src value from. | src | | attributes.transforms | string | The HTML attribute to search for Cloudinary transform values on. Must be a comma delimited list of valid Cloudinary transforms. | data-clb-transforms | | cname | string | The domain name that Cloudinary URLs should be constructed with. | res.cloudinary.com | | privateCdn | boolean | Whether a private CDN is being used. For advanced tier Cloudinary users only | false | | secure | boolean | Whether to use https protocol, even if the viewed webpage is http | true | | wrapperSelectors | string | A comma delimited list of valid CSS selectors to source transforms from. Useful for markdown content. | undefined | | template | string | A valid mustachejs template for rendering the lightbox. Use the {{{ image }}} variable to place the generated image. | Default template | | transforms | string | The default transforms to apply if none are set using attributes.transforms | w_auto,c_scale,dpr_auto |

Custom Styling (CSS)

If you want to customize the CSS for the lightbox, feel free to exclude or extend the very basic default theme with your own CSS.

Client Hints

By default, this plugin is setup to deliver the best image possible via client hints. To enable this functionality, add the following to the <head> of your page:

<meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width">

Contributors

Thanks goes to these wonderful people (emoji key):

| chrisdmacrae[💻](https://github.com/forestryio/Cloudinary Lightbox/commits?author=chrisdmacrae "Code") | | :---: |

This project follows the all-contributors specification. Contributions of any kind welcome!