Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Gathering detailed insights and metrics for @sitelintcode/accessible-gallery
Simple images gallery that is accessible, responsive and with preloading
npm install @sitelintcode/accessible-gallery
Typescript
Module System
Node Version
NPM Version
67.1
Supply Chain
99.2
Quality
83.7
Maintenance
100
Vulnerability
100
License
TypeScript (72.84%)
SCSS (20.79%)
JavaScript (6.22%)
Shell (0.15%)
Total Downloads
4,295
Last Day
1
Last Week
41
Last Month
129
Last Year
1,352
77 Commits
1 Watching
3 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.2.16
Package Id
@sitelintcode/accessible-gallery@1.2.16
Unpacked Size
33.00 kB
Size
9.25 kB
File Count
4
NPM Version
10.9.0
Node Version
23.3.0
Publised On
21 Nov 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-19.6%
41
Compared to previous week
Last month
-3%
129
Compared to previous month
Last year
-47.9%
1,352
Compared to previous year
3
35
Accessible Gallery allows you to create an image gallery automatically directly from the HTML.
1npm install @sitelintcode/accessible-gallery --save
1 <ul class="accessible-gallery" data-accessible-gallery 2 data-accessible-gallery-config='{"galleryTitle":"Gallery of images in a modal dialog","loadingMessage":"The image is being loaded","closeButtonMessage":"Close gallery", "previousImage":"Previous","nextImage":"Next", "closeButton":"Close dialog"}'> 3 4 <li class="accessible-gallery__item" data-accessible-gallery-item> 5 <a href="#no_image" data-accessible-gallery-link> 6 <img loading="lazy" alt="Placeholder" data-accessible-gallery-thumbnail="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOHPmzH8ACDADZKt3GNsAAAAASUVORK5CYII=" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjOHPmzH8ACDADZKt3GNsAAAAASUVORK5CYII="> 7 </a> 8 </li> 9 10 <li class="accessible-gallery__item" data-accessible-gallery-item> 11 <a href="images/castelmezzano-1979546_1920.jpeg" data-accessible-gallery-link> 12 <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/castelmezzano-1979546_1920_thumbnail.jpeg"> 13 </a> 14 </li> 15 16 <li class="accessible-gallery__item" data-accessible-gallery-item> 17 <a href="images/sunset-3325080_1920.jpeg" data-accessible-gallery-link> 18 <img loading="lazy" alt="Sunset in mountains" src="images/sunset-3325080_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/sunset-3325080_1920_thumbnail.jpeg"> 19 </a> 20 </li> 21 22 </ul>
1 import AccessibleGallery from '@sitelint/accessible-gallery'; 2 3 const accessibleGallery = new AccessibleGallery(); 4 5 accessibleGallery.init();
src="data:image/png;base64,..."
.import { terser } from "rollup-plugin-terser";
was replaced with import { terser } from "rollup-plugin-minification";
because rollup-plugin-terser
is not compatible with Rollup 3.x version. See: https://github.com/TrySound/rollup-plugin-terser/issues/119DOMContentLoaded
event automatically. Eventually, if event DOMContentLoaded
was called after Accessible Gallery code was loaded then the gallery will run immediately.Optionally you may want to set custom messages, e.g. for localisation purpose. An attribute data-accessible-gallery-config
contains config for all strings.
1{ 2 "galleryTitle": "Gallery of images in a modal dialog", 3 "loadingMessage": "The image is being loaded", 4 "closeButtonMessage": "Close gallery", 5 "previousImage": "Previous", 6 "nextImage": "Next", 7 "closeButton": "Close dialog" 8}
Note: above config is being stored as a valid JSON string under attribute data-accessible-gallery-config
.
The data-accessible-gallery-thumbnail
attribute allow you to specify a custom small thumbnail generated at the very bottom of the page. Keep the value empty when you want to pick the image src
.
This <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail="images/castelmezzano-1979546_1920_bottom_thumbnail.jpeg">
will pick images/castelmezzano-1979546_1920_bottom_thumbnail.jpeg
when rendering mini thumbnails at the very bottom of the page.
This <img loading="lazy" alt="Castelmezzano by night" src="images/castelmezzano-1979546_1920_thumbnail.jpeg" data-accessible-gallery-thumbnail>
will pick images/castelmezzano-1979546_1920_thumbnail.jpeg
when rendering mini thumbnails at the very bottom of the page.
Yes. See above "Options".
Contributions are welcome, and greatly appreciated! Contributing doesn't just mean submitting pull requests. There are many different ways for you to get involved, including answering questions on the issues, reporting or triaging bugs, and participating in the features evolution process.
Images coming from Pixabay
MIT
No vulnerabilities found.
No security vulnerabilities found.