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

lc-lightbox

v0.9.2

Published

A lightbox component using the dialog HTML element

Downloads

7

Readme

🥕 Low-cal Lightbox

A simple lightbox for a single image. To use, wrap your image tag with <lc-lightbox></lc-lightbox> tags. Now you can click the image to get a lightbox view of that image.

With no attributes, the image src will be used for the lightbox image.

<lc-lightbox>
  <img src="somewhere/over/the/rainbow.jpg">
</lc-lightbox>

Optional attributes are:

The default is 640px.

<lc-lightbox src="a/bigger/image.jpg" min-width="300" disabled="1" debug="templates">
  <img src="somewhere/over/the/rainbow.jpg">
</lc-lightbox>

If further customization needs to be done, add a <template> to the document and give it an id of lightbox-template. This will override the default one. It should be added before the script tag.

This example is the same as the default one, except it adds a white border around the lightbox image.

<template id="low-cal-template">
  <style>
    *{
      box-sizing: border-box;
    }
    .container{
      display: none;
      place-content: center;
      cursor: zoom-out;
      position: fixed;
      top: 0;
      left: 0;
      height: 100dvh;
      width: 100%;
      background-color: rgba(0, 0, 0, 0.9);
      padding: 2rem;
      opacity: 0;
      transition: opacity 0.3s;
      & img{
        max-height: 100%;
        max-width: 100%;
        margin: auto;
        background-color: white;
      }
    }
    .showing{
      opacity: 1;
    }
    img{
      border: 10px solid white;
    }
  </style>
  <slot></slot>
  <div class="container">
    <img class="image">
  </div>
</template>

Dev

  • npm run build
  • npm pack lc-lightbox/ - The trailing slash is required.
  • npm login
  • npm publish lc-lightbox

Images from https://unsplash.com