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 🙏

© 2025 – Pkg Stats / Ryan Hefner

eleventy-plugin-img-magnifier

v1.2.7

Published

zoom image to fullscreen

Readme

eleventy-plugin-img-magnifier : zoom image to fullscreen

Enlarge images and create a lightbox to view fullscreen. When hovering an img, the cursor is changed as a magnifying glass to indicates to the user that the img can be enlarged. A click and the img appears enlarged, through a fade-in animation and the background get darker. A click outside the image quit the enlarged view.

showcase.webm

![A user clicks on a blog image, the image appears fullscreen on a darker background in a fade-in animation, the user clicks outside and the image disappear]

You have nothing particular to do, the plugin automatically handle your existing images

Installation

npm install eleventy-plugin-img-magnifier

Then register it in your config .eleventy.js file :

import imgMagnifier from "eleventy-plugin-img-magnifier"

export default function(eleventyConfig) {
    eleventyConfig.addPlugin(imgMagnifier)
}

Place the {% imgmagnifier %} shortcode on your desired pages/templates in the <head>of your HTML file

How does it work ?

When the image is clicked, a js script loads and dynamically inserts a <dialog> HTML modal right before the image in its container. When the outside of the modal is clicked the dialog automatically disappears. The overall is styled and transitioned via native CSS @starting-style rule and <dialog> targeting. Now supporting :

  • native light dismiss
  • keyboard navigation (ESC to close)

Progressive enhancement

New <dialog> closedby="any" attribute allows to light dismiss the element without any JS (was not possible on <dialog> until May 2025). Still keeping the JS function that allows legacy closing till Baseline.

Requirements

It's based on ESM so Eleventy 3.0 minimum is required.