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

ng-opengallery

v0.0.6

Published

Opengallery is an Angular library component for efficient gallery rendering and interactions (images & videos)

Downloads

9

Readme

Opengallery

Opengallery is an Angular library component for efficient gallery rendering and interactions (images & videos). The gallery layout is responsive for all devices and loads the content only if it's in the viewport. A media viewer is shipped and included with this library. You can configure the component the way you want.

Demo

Try it out here: DEMO or clone this repo and run ng serve for a full demo of opengallery. Built with angular version 9.

Features

  • Fast & efficient gallery rendering
  • Loads content when they enter the viewport
  • Supports video/image mixed in the gallery
  • Play/Pause the video when the enter/exit the viewport (some browser block autoplay)
  • Different layouts to choose from and customise the way you want it (simple, catalog, carousel, masonry)
  • Include a media viewer modal to click and view the media (diaporama support, keystroke support)
  • Automatically hides media when they cannot be loaded
  • Detect dynamically new changes in medias and adapt itself

How to use

First install the package with the command npm i ng-opengallery

Then, in your module.ts, import the library module

import { NgOpengalleryModule } from 'ng-opengallery';

And add it to your imports modules, then you can use it in any component.html

<ng-opengallery
    [datasource]='this.data'
    [config]='this.config'
    (change)='onChange($event)'
    (error)='onError($event)'
    (selection)='onSelection($event)'
    (open)='onOpen($event)'>
</ng-opengallery>

If you want a full code demo, check out the repository on github here

Inputs

| Property | Type | Note | | -------- | ---- | ---- | | [datasource] | Array(Media) | Media datasource with data | | [config] | Config | Configuration of the gallery (prefMediaHeight,spacing,layout,viewerEnabled,viewerFullsize,diaporamaDuration,enableAutoPlay) | | [config.prefMediaHeight] | number | prefered height size of media in the layouts, default is 250 | | [config.spacing] | number | spacing between media, is not taken into account for the caroussel layout, default is 2 | | [config.layout] | LayoutStyle | Specify the media layout you want (SIMPLE, CATALOG, CAROUSEL, MASONRY), default is SIMPLE | | [config.viewerEnabled] | boolean | Specify whether the modal viewer should appear when a media is clicked, default is true | | [config.viewerFullsize] | boolean | Specify whether the media in the modal viewer should take the full width and height available, default is false | | [config.diaporamaDuration] | number | Duration for the diaporama in the modal viewer, if 0 is specified, diaporama is disabled, default is 3 | | [config.enableAutoPlay] | number | Specify if a media should start when it enters the viewport, default is true | | [config.effectClass] | string | Special effect applied on media defined by the user, if null no effect is applied, default is null |

Outputs

| Event | Type | Note | | -------- | ---- | ---- | | (change) | Media | Emits the current media when the diaporama changes automatically or by the user (carousel,media viewer) | | (error) | Media | Emits the media that caused an error (could not be loaded) | | (selection) | Media | Emits the media that was selected by the user | | (open) | boolean | Emits a boolean when the media viewer is opened or closed |

To-Do / Improvements

  • Move some logic in service and remove from components
  • Add Squared layout
  • Add animations support
  • Add Iframe support

NPM

This package is on npm https://www.npmjs.com/package/ng-opengallery

License

This package is under the MIT license