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

@positioner/psk-gallery

v1.1.0-7

Published

Frontend package for PSK Gallery

Downloads

654

Readme

PSK Gallery

Frontend package for PSK Gallery

Install

npm i @positioner/psk-gallery

Usage

JS

<!-- Include with a CDN -->
<script src="https://unpkg.com/@positioner/[email protected]/js/psk-gallery.min.js"></script>

SCSS

// Include in your stylesheet
@import '../node_modules/@positioner/psk-gallery/scss/psk-gallery';

API

void PskGallery.init(url, [options])

Initializes the gallery and opens it.

url

Type: string

Url pointing to the JSON API (e.g /Umbraco/Api/PskGallery/…)

options

Type: object

A configuration object, see properties below

void PskGallery.initWithJson(json, [options])

Initializes the gallery and opens it.

json

Type: object

JSON object equal to the one returned by the API /Umbraco/Api/PskGallery/…

options

Type: object

A configuration object, see properties below

void PskGallery.close()

Closes the gallery if it's open.

Options

| Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | initialSlide | number | 0 | The index of the slide that should be opened first | | onOpen | function | ()=>{} | Function called when the gallery is open. A TransitionEvent will be passed as the first parameter | | onClose | function | ()=>{} | Function called when the gallery is closed. A TransitionEvent will be passed as the first parameter | | visibleMediaIds | function | ()=>[] | Function that should return an array of IDs of the currently visible elements. The IDs returned refer to the Umbraco media ID. Should be used when a filtrable gallery is present |

Customization

Some commonly customized properties have exposed variables

| Variable | Default | Description | | :--- | :--- | :--- | | --psk-gallery-bg | $body-bg or black | Gallery background color | | --psk-gallery-fg | $body-color or white | Gallery foreground color | | --psk-gallery-padding | 60px | Padding around the image / video | | --psk-gallery-z-index | 1000 | Gallery z-index value | | --psk-gallery-close-top | 1.5rem | Close button distance from the top | | --psk-gallery-close-right | 1.5rem | Close button distance from the right | | --psk-gallery-transition-speed | $base-duration or 0.25s | Opacity transition speed |

Development and release

  1. Install dependencies:

    npm install
  2. Make changes, update version number and release notes (below), tag your release commit with new version.

  3. Publish the updated library

    npm publish

Release notes

1.1.0-7 - 31.10.2024

  • Add minified version of the script
  • Add "Development and release" section in readme
  • Suggest usage of unpkg cdn rather than jsdelivr in readme

1.1.0-6 - 29.10.2024

  • Add initWithJson method

1.1.0-5 - 11.01.2024

  • Fix flashing of first image for a brief period on open
  • Prevent slides content from being selected and looking ugly
  • Remove obsolete styles for swiper@8

1.1.0-4 - 10.01.2024

  • Added visibleMediaIds option for filtrable galleries (to be used with /Umbraco/Api/PskGallery/GetMediaItems URL)

1.1.0-3 - 06.12.2023

  • Added support for swiper@11
  • Dropped support for swiper@8

1.1.0-2 - 18.10.2023

  • Added support for mimeType in video

1.1.0-1 - 07.07.2022

  • Added lazy load in previous and next slides

1.1.0-0 - 14.06.2022

  • BREAKING First release where the frontend package is separated from the backend, install this separately with npm i @positioner/psk-gallery
  • BREAKING Renamed main export from pskGallery to PskGallery
  • Added small threshold to swiper slider to prevent accidental swipes
  • Added check for video ready state before trying to play it
  • Converted JS code to ES6 class
  • Fixed vertically stretched video bug (controls not aligned with video)