@francescograzioso/modal-angular-gallery v0.0.5
Do you like modal-angular-gallery? Please, add a 'star' to support this library
modal-angular-gallery is an Angular library (SSR compatible) to create image galleries of clickable thumbnails.
After a click, it will display a modal window with full screen images.
Modal view is composed by buttons, the current image and optionally, also navigation dots and previews.
It's also possible to navigate between these modal images with both keyboard arrows, swipe gestures and mouse clicks and close it pressing esc
.
This library uses Semantic versioning 2.0.0 also known as 'semver'
requires Internet Explorer >= 11 and Angular >= 5
Features
- Angular module to import this library
- works with IE >= 11
- AOT support
- Angular >= 5
- compliant to Angular Package Format v5 specifications
- unit testing with high % coverage
- Server Side Rendering support with angular-universal
- Web Accessibility features, like ARIA support and toptal.com criteria (tested with
Sim Daltonism
for macOS) - image download with buttons or keyboard shortcuts
- advanced keyboard shortcuts with
mousetrap
(both local and global) - fully configurable default buttons to either close, download, navigate to an external url or delete images
- support custom buttons with both pre and after hooks
- click outside feature to close the modal gallery clicking on the background
- configurable plain gallery
- configurable side-previews (visible only on bigger screen)
- configurable dots navigation (visible only on bigger screen)
- configurable previews (visible only on bigger screen)
- and so on... (OFFICIAL DOCUMENTATION WILL BE WRITTEN SOON)
Installation
npm i @francescograzioso/modal-angular-gallery
npm install --save hammerjs mousetrap rxjs-compat
npm install --save-dev @types/mousetrap @types/hammerjs
NPM Link
Angular Modal Gallery
FAQS
- Question: I have this error:
Cannot find name 'MousetrapInstance'
. What can I do? Answer: Simply runnpm i --save-dev @types/mousetrap
- Question: I have this error:
Error: No provider for KeyboardService
. What can I do? Answer: You forgot to add .forRoot(), so KeyboardService will be never available as a service. Please read section "Installation" HERE. This is a common design pattern for Angular libraries. For more info check also this issue. - Question: How can I remove images using DELETE button without issues? Answer: You cannot change the input image array. Instead, you should reassign it with a newer array without the deleted element. In other words, you must think in a functional way, without changing the input array of images.
A big thank you to
all authors of icons used in this library:
- Icons made by Smartline from www.flaticon.com is licensed by CC 3.0 BY
- Icons made by Dave Gandy from www.flaticon.com is licensed by CC 3.0 BY
- Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY
- Icons made by Those Icons from www.flaticon.com is licensed by CC 3.0 BY
- Icons made by Gregor Cresnar from www.flaticon.com is licensed by CC 3.0 BY
- Icons made by Smashicons from www.flaticon.com is licensed by CC 3.0 BY
all authors of spinners used in this library:
- Luke Haas (@lukehaas) - lukehaas/css-loaders
- Martin van Driel (@martinvd) - martinvd example on codepen.io
- Devilish Alchemist - devilishalchemist example on codepen.io
- Nikhil Krishnan - nikhil8krishnan example on codepen.io
- Anastasiya Kuligina - Anastasiya Kuligina example on codepen.io
License
The MIT License (MIT)
Copyright (c) 2017-2018 Francesco Grazioso (@francescograzioso)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Created by Francesco Grazioso