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

@juji/photoswipe

v5.4.10

Published

JavaScript gallery

Readme

Stand With Ukraine

PhotoSwipe v5 — JavaScript image gallery and lightbox

Demo | Documentation

Sponsor via OpenCollective Follow on Twitter

About This Fork

This is a fork of the original PhotoSwipe library. It includes additional enhancements for smoother user interactions:

  • Smooth Transition Animations: Added animated transitions for slide navigation via arrow buttons and keyboard arrow keys
  • Rapid Input Handling: Properly manages rapid button/key presses to prevent animation conflicts
  • Accessibility Support: Respects prefers-reduced-motion for users who prefer reduced animations
  • Dynamic Timing: Uses the CSS custom property --pswp-transition-duration for consistent timing
  • Dark Theme Support: Includes basic-dark.css for easy dark theme implementation

These changes maintain full compatibility with the original PhotoSwipe API and behavior.

About Basic Dark Theme

The basic-dark.css file provides a complete dark theme for PhotoSwipe with the following features:

  • CSS Custom Properties:

    • --pswp-theme-background-base: Controls the base background color (default: black)
    • --pswp-theme-foreground-base: Controls text and icon colors (default: white)
    • --pswp-theme-radius: Controls border radius for UI elements (default: 0.3rem)
  • Enhanced UI Elements:

    • Semi-transparent backgrounds with backdrop blur effects
    • Improved button styling with hover states
    • Responsive arrow button design
    • Modern glassmorphism aesthetic
  • Animation Support: Includes blur animations for opening/closing transitions using the pswp--closing class

To use the dark theme, simply include basic-dark.css after the main PhotoSwipe CSS:

import '@juji/photoswipe/basic-dark.css';

Screenshot

basic-dark Example: Dark Theme Demo

Repo structure

  • dist/ - main JS and CSS
  • src/ - source JS and CSS.
    • src/js/photoswipe.js - entry for PhotoSwipe Core.
    • src/js/lightbox/lightbox.js - entry for PhotoSwipe Lightbox.
  • docs/ - documentation markdown files.
  • demo-docs-website/ - website with documentation, demos and manual tests.
  • build/ - rollup build config.

To build JS and CSS in dist/ directory, run npm run build.

To run the demo website and automatically rebuild files during development, run npm install in demo-docs-website/ and npm run watch in the root directory.

Older versions

Documentation for the old version (v4) can be found here and the code for 4.1.3 is here.


This project is tested with BrowserStack.