A library that allows you to display images with with natural layouts, infinite scroll, lazy loading, lightbox and interactivity in a developer friendly by exposing an usefull api.
pnpm add @ecodev/natural-gallery-jsAll contributions are welcome, but keep in mind that the gallery will stay simple : too generalist or too specific features that could be done from your controllers won't be added.
Create an issue where you report what you observe, what you expect to observe, and the context of usage, as well as your browser and it's version.
Consider a pull request, but create an issue before to expose your idea. Maybe the feature you would like to add is already on the pipeline or is intentionally not included for good reasons.
The most useful commands for development are:
pnpm devto start a development serverpnpm buildto build the lib and the docs locally (it will be published automatically by GitHub Actionsdeployjob)git tag -am 1.2.3 1.2.3 && git pushto publish the lib to npm (via GitHub Actionsreleasejob)
While pnpm dev runs, the docs are served on http://localhost:4000, including two test pages:
- http://localhost:4000/test is the page used by the e2e tests. The page starts empty, each test creates its own gallery.
Natural,Square,Masonryandimagesare available as globals, so a gallery can be created from the browser console:new Natural(document.getElementById('gallery'), {rowHeight: 400}).addItems(images);
- http://localhost:4000/test-raw shows a Natural gallery already filled with images.
Developed by Ecodev under MIT licence, the app is free of use, even for commercial usage. Even if it's not required, a credit would be much appreciated.
This gallery uses Photoswipe !
